[IMP] removing structure in partner tags
[odoo/odoo.git] / openerp / cron.py
index 317d695..7b67877 100644 (file)
@@ -49,13 +49,6 @@ import tools
 
 _logger = logging.getLogger(__name__)
 
-# Scheduling wake-ups (see below) can be disabled when the polling process
-# workers are used instead of the managed thread workers. (I.e. wake-ups are
-# not used since polling is used. And polling is used when the cron are
-# handled by running special processes, e.g. openerp-cron-worker, instead
-# of the general openerp-server script.)
-enable_schedule_wakeup = True
-
 # Heapq of database wake-ups. Note that 'database wake-up' meaning is in
 # the context of the cron management. This is not originally about loading
 # a database, although having the database name in the queue will
@@ -142,6 +135,7 @@ def cancel_all():
         _wakeups = []
         _wakeup_by_db = {}
 
+
 def schedule_wakeup(timestamp, db_name):
     """ Schedule a new wake-up for a database.
 
@@ -153,9 +147,6 @@ def schedule_wakeup(timestamp, db_name):
     :param timestamp: when the wake-up is scheduled.
 
     """
-    global enable_schedule_wakeup
-    if not enable_schedule_wakeup:
-        return
     if not timestamp:
         return
     with _wakeups_lock:
@@ -213,12 +204,9 @@ def start_master_thread():
         _logger.warning("Connection pool size (%s) is set lower than max number of cron threads (%s), "
                         "this may cause trouble if you reach that number of parallel cron tasks.",
                         db_maxconn, _thread_slots)
-    if _thread_slots:
-        t = threading.Thread(target=runner, name="openerp.cron.master_thread")
-        t.setDaemon(True)
-        t.start()
-        _logger.debug("Master cron daemon started!")
-    else:
-        _logger.info("No master cron daemon (0 workers needed).")
+    t = threading.Thread(target=runner, name="openerp.cron.master_thread")
+    t.setDaemon(True)
+    t.start()
+    _logger.debug("Master cron daemon started!")
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: