summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Biersbach <cbi@openerp.com>2013-03-22 15:30:46 +0100
committerChris Biersbach <cbi@openerp.com>2013-03-22 15:30:46 +0100
commitaee22b95f25bdfaffdfbdb0fbd10dbf6797b4358 (patch)
tree4b9d4efda1c2852a76f7added688033ca6a86e87
parent46dc796812b0b3fca533a141a4811aa40e1d1c76 (diff)
parent6eefd15744106f61240fbe6a34f08ae968a6ba7f (diff)
[MERGE] Forwardport of fix from 6.1 revision 4334 that sometimes caused an import error when starting a cron
bzr revid: cbi@openerp.com-20130322143046-xcdqdm8dfxngvo4o
-rw-r--r--openerp/service/cron.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/openerp/service/cron.py b/openerp/service/cron.py
index f3c81fe785f..773191d0095 100644
--- a/openerp/service/cron.py
+++ b/openerp/service/cron.py
@@ -30,6 +30,7 @@ cron jobs, for all databases of a single OpenERP server instance.
import logging
import threading
import time
+from datetime import datetime
import openerp
@@ -60,6 +61,12 @@ def start_service():
threads it spawns are not marked daemon).
"""
+
+ # Force call to strptime just before starting the cron thread
+ # to prevent time.strptime AttributeError within the thread.
+ # See: http://bugs.python.org/issue7980
+ datetime.strptime('2012-01-01', '%Y-%m-%d')
+
for i in range(openerp.tools.config['max_cron_threads']):
def target():
cron_runner(i)