Convert interval into seconds

The correct way to convert interval into seconds is to use
"EXTRACT(EPOCH FROM ...)". The "SECOND" gives only the value of the second
field.

issue9126
review297181005
This commit is contained in:
Cédric Krier committed 2020-03-17 23:21:20 +01:00
1 parent 62f2ce0198
commit 5e41ca21f9
1 file changed
+1 -1
+1 -1
View File
@@ -108,7 +108,7 @@ class Queue(ModelSQL):
selected.for_ = For('UPDATE')
next_timeout = With('seconds', query=candidates.select(
Min(Extract('second',
Min(Extract('EPOCH',
candidates.scheduled_at - CurrentTimestamp())
),
where=candidates.scheduled_at >= CurrentTimestamp()))