Skip to content

Commit 754e438

Browse files
author
Milan Topuzov
committed
jobrunner: restore list/CSV handling in get_db_names (no comments)
1 parent d25ff12 commit 754e438

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

queue_job/jobrunner/runner.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,12 @@ def from_environ_or_config(cls):
472472
return runner
473473

474474
def get_db_names(self):
475-
if config["db_name"]:
476-
db_names = config["db_name"]
477-
else:
478-
db_names = odoo.service.db.list_dbs(True)
479-
return db_names
475+
db_name_opt = config["db_name"]
476+
if db_name_opt:
477+
if isinstance(db_name_opt, (list, tuple, set)):
478+
return list(db_name_opt)
479+
return [n for n in str(db_name_opt).split(",") if n]
480+
return odoo.service.db.list_dbs(True)
480481

481482
def close_databases(self, remove_jobs=True):
482483
for db_name, db in self.db_by_name.items():

0 commit comments

Comments
 (0)