Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] Allow use in multidb enviroments and list_db = false #580

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion queue_job/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,16 @@ def from_environ_or_config(cls):
return runner

def get_db_names(self):
"""
>>> runner = QueueJobRunner()
>>> config["db_name"] = None
>>> runner.get_db_names()
['odoo']
"""
if config["db_name"]:
db_names = config["db_name"].split(",")
else:
db_names = odoo.service.db.exp_list(True)
db_names = odoo.service.db.list_dbs(True)
return db_names

def close_databases(self, remove_jobs=True):
Expand Down
Loading