summaryrefslogtreecommitdiff
path: root/odoo/service/server.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-04-06 09:39:47 +0000
committerXavier Morel <xmo@odoo.com>2020-04-06 09:45:29 +0000
commit9d37cecfca8e6b8d4c0e2880f422673c526a3aef (patch)
treef1da785820ca7b0f3ab5124aff9212dac7267320 /odoo/service/server.py
parenteacc9bfe2579bf833a4620e4d1030fa075e18d32 (diff)
[FIX] core: iterations on LRU
Iteration methods on LRU were removed because they were not thread-safe and it's not clear that making them thread-safe is the correct thing to do, so not providing them seems saner. I thought I'd looked for usages of the LRU but apparently didn't look hard enough as I missed that it's used by the cron workers (apparently using the threaded server we only run crons for dbs currently living in the registry cache, the more you know). Convert these to iterating on the LRU's internal mapping, and also don't iterate on the LRU to clear its entries one by one when we can just clear the entire thing safely, although Registry.delete_all really seems completely unused. closes odoo/odoo#49023 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/service/server.py')
-rw-r--r--odoo/service/server.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/service/server.py b/odoo/service/server.py
index cffb6cd4373..0d22862818d 100644
--- a/odoo/service/server.py
+++ b/odoo/service/server.py
@@ -403,7 +403,7 @@ class ThreadedServer(CommonServer):
time.sleep(SLEEP_INTERVAL + number) # Steve Reich timing style
registries = odoo.modules.registry.Registry.registries
_logger.debug('cron%d polling for jobs', number)
- for db_name, registry in registries.items():
+ for db_name, registry in registries.d.items():
if registry.ready:
thread = threading.currentThread()
thread.start_time = time.time()