[CLEAN] Query: cleaned a bit the code. All joins now goes through the same method...
[odoo/odoo.git] / openerp / cron.py
index 0d79e23..7b67877 100644 (file)
@@ -47,6 +47,8 @@ import time
 import openerp
 import tools
 
+_logger = logging.getLogger(__name__)
+
 # 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
@@ -84,8 +86,6 @@ _thread_slots = None
 # A (non re-entrant) lock to protect the above _thread_slots variable.
 _thread_slots_lock = threading.Lock()
 
-_logger = logging.getLogger('cron')
-
 # Sleep duration limits - must not loop too quickly, but can't sleep too long
 # either, because a new job might be inserted in ir_cron with a much sooner
 # execution date than current known ones. We won't see it until we wake!
@@ -176,6 +176,7 @@ def runner_body():
             timestamp, db_name, canceled = task
             if canceled:
                 continue
+            del _wakeup_by_db[db_name]
             registry = openerp.pooler.get_pool(db_name)
             if not registry._init:
                 _logger.debug("Database '%s' wake-up! Firing multi-threaded cron job processing", db_name)