From 41218715bdcdbbe0b5c34026caaea79bf3c624f5 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 27 Dec 2011 23:39:44 +0100 Subject: [PATCH] [FIX] cron mktime should be timegm bzr revid: al@openerp.com-20111227223944-jk1humfvon1kqw59 --- openerp/addons/base/ir/ir_cron.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_cron.py b/openerp/addons/base/ir/ir_cron.py index af46b0ef3e0..6a4adbd2026 100644 --- a/openerp/addons/base/ir/ir_cron.py +++ b/openerp/addons/base/ir/ir_cron.py @@ -19,6 +19,7 @@ # ############################################################################## +import calendar import time import logging import threading @@ -174,7 +175,7 @@ class ir_cron(osv.osv): if numbercall: # Reschedule our own main cron thread if necessary. # This is really needed if this job runs longer than its rescheduling period. - nextcall = time.mktime(nextcall.timetuple()) + nextcall = calendar.timegm(nextcall.timetuple()) openerp.cron.schedule_wakeup(nextcall, cr.dbname) finally: cr.commit() @@ -251,7 +252,7 @@ class ir_cron(osv.osv): next_call = cr.dictfetchone()['min_next_call'] if next_call: - next_call = time.mktime(time.strptime(next_call, DEFAULT_SERVER_DATETIME_FORMAT)) + next_call = calendar.timegm(time.strptime(next_call, DEFAULT_SERVER_DATETIME_FORMAT)) else: # no matching cron job found in database, re-schedule arbitrarily in 1 day, # this delay will likely be modified when running jobs complete their tasks