diff options
| author | Antony Lesuisse <al@openerp.com> | 2011-12-27 23:39:44 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2011-12-27 23:39:44 +0100 |
| commit | 41218715bdcdbbe0b5c34026caaea79bf3c624f5 (patch) | |
| tree | 7c197b1aecafa74a4abf7ec5bd2592a093c085b0 | |
| parent | 3ca07993d729d0ee28fa69b3d5b79333c4950c35 (diff) | |
[FIX] cron mktime should be timegm
bzr revid: al@openerp.com-20111227223944-jk1humfvon1kqw59
| -rw-r--r-- | openerp/addons/base/ir/ir_cron.py | 5 |
1 files 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 |
