changeset f6f8c84534be in trytond:5.2
details: https://hg.tryton.org/trytond?cmd=changeset;node=f6f8c84534be
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 41cf0be9e20c -r f6f8c84534be trytond/ir/queue.py
--- a/trytond/ir/queue.py       Mon Mar 09 18:29:53 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