Move as much as possible import after the configuration
issue5564 review25321002
This commit is contained in:
1 parent
74dcfeb6a6
commit
4923eb4baf
1 file changed
+5
-4
+5
-4
@@ -14,16 +14,17 @@ if os.path.isdir(DIR):
|
||||
|
||||
import trytond.commandline as commandline
|
||||
from trytond.config import config, split_netloc
|
||||
from trytond.application import app
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules import get_module_list, get_module_info
|
||||
|
||||
|
||||
parser = commandline.get_parser_daemon()
|
||||
options = parser.parse_args()
|
||||
commandline.config_log(options)
|
||||
config.update_etc(options.configfile)
|
||||
|
||||
# Import trytond things after it is configured
|
||||
from trytond.application import app
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules import get_module_list, get_module_info
|
||||
|
||||
with commandline.pidfile(options):
|
||||
for name in options.database_names:
|
||||
Pool(name).init()
|
||||
|
||||
Reference in new issue
Block a user