Skip to content
Open
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion queue_job/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from . import wizards
from . import jobrunner
from .post_init_hook import post_init_hook
from .post_load import post_load

# shortcuts
from .job import identity_exact
1 change: 0 additions & 1 deletion queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@
"development_status": "Mature",
"maintainers": ["guewen", "sbidoul"],
"post_init_hook": "post_init_hook",
"post_load": "post_load",
}
3 changes: 1 addition & 2 deletions queue_job/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ def _get_failure_values(cls, job, traceback_txt, orig_exception):
save_session=False,
readonly=False,
)
def runjob(self, db, job_uuid, **kw):
http.request.session.db = db
def runjob(self, job_uuid, **kw):
env = http.request.env(user=SUPERUSER_ID)
job = self._acquire_job(env, job_uuid)
if not job:
Expand Down
6 changes: 4 additions & 2 deletions queue_job/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ def _async_http_get(scheme, host, port, user, password, db_name, job_uuid):
# if this was python3 I would be doing this with
# asyncio, aiohttp and aiopg
def urlopen():
url = f"{scheme}://{host}:{port}/queue_job/runjob?db={db_name}&job_uuid={job_uuid}"
url = f"{scheme}://{host}:{port}/queue_job/runjob?job_uuid={job_uuid}"
# pylint: disable=except-pass
try:
auth = None
if user:
auth = (user, password)
# we are not interested in the result, so we set a short timeout
# but not too short so we trap and log hard configuration errors
response = requests.get(url, timeout=1, auth=auth)
response = requests.get(
url, timeout=1, auth=auth, headers={"X-Odoo-Database": db_name}
)

# raise_for_status will result in either nothing, a Client Error
# for HTTP Response codes between 400 and 500 or a Server Error
Expand Down
25 changes: 0 additions & 25 deletions queue_job/post_load.py

This file was deleted.

Loading