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:
1 parent
62f2ce0198
commit
5e41ca21f9
1 file changed
+1
-1
+1
-1
@@ -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()))
|
||||
|
||||
Reference in new issue
Block a user