From 356b0cdcfa09b3de593a47da415dfd766635d671 Mon Sep 17 00:00:00 2001 From: Binh Nguyen Date: Fri, 11 Jan 2019 16:19:48 +0700 Subject: [PATCH] [FIX] check workers in config before check preload_registries condition --- smile_upgrade/models/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smile_upgrade/models/registry.py b/smile_upgrade/models/registry.py index 464d19da7..502c98131 100644 --- a/smile_upgrade/models/registry.py +++ b/smile_upgrade/models/registry.py @@ -22,7 +22,8 @@ @classmethod def new(cls, db_name, force_demo=False, status=None, update_module=False): callers = [frame[3] for frame in inspect.stack()] - if 'preload_registries' not in callers and \ + if tools.config.options.get('workers', False) and \ + 'preload_registries' not in callers and \ '_initialize_db' not in callers: return native_new(db_name, force_demo, status, update_module) with cls._lock: