changeset 7ab2d9708d71 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=7ab2d9708d71
description:
        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
diffstat:

 trytond/ir/queue.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 82df091bf5ae -r 7ab2d9708d71 trytond/ir/queue.py
--- a/trytond/ir/queue.py       Tue Mar 17 20:08:13 2020 +0100
+++ b/trytond/ir/queue.py       Tue Mar 17 23:21:20 2020 +0100
@@ -108,7 +108,7 @@
             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()))

Reply via email to