changeset 11a896467ca4 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=11a896467ca4
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
        (grafted from 7ab2d9708d71280e3bd6885f0d1916b8bcec092e)
diffstat:

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

diffs (12 lines):

diff -r 0d55dfc93171 -r 11a896467ca4 trytond/ir/queue.py
--- a/trytond/ir/queue.py       Mon Mar 09 18:30:26 2020 +0100
+++ b/trytond/ir/queue.py       Tue Mar 17 23:21:20 2020 +0100
@@ -103,7 +103,7 @@
                     candidates.expected_at.nulls_first],
                 limit=1))
         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