Skip to content

Commit

Permalink
ADD: Indico Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sihrc committed Sep 6, 2020
1 parent 98e9856 commit 3e12dad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -31,3 +31,4 @@ htmlcov/
coverage.xml
test.db
pip-wheel-metadata/
.vscode/
6 changes: 6 additions & 0 deletions celery/app/task.py
Expand Up @@ -1004,6 +1004,12 @@ def add_trail(self, result):
return result

def push_request(self, *args, **kwargs):
# indico
# we want access to args & kwargs in our copied context
# TODO: consider making a copy - need to make sure arguments are small enough
# to avoid dup mem.
self.request.args = args
self.request.kwargs = kwargs
self.request_stack.push(Context(*args, **kwargs))

def pop_request(self):
Expand Down
6 changes: 6 additions & 0 deletions celery/backends/base.py
Expand Up @@ -238,6 +238,12 @@ def chord_error_from_stack(self, callback, exc=None):
# need below import for test for some crazy reason
from celery import group # pylint: disable
app = self.app

# indico
# Revoke causes callbacks id to be None
if callback.id is None and callback.tasks:
callback.id = callback.tasks[0].id

try:
backend = app._tasks[callback.task].backend
except KeyError:
Expand Down

0 comments on commit 3e12dad

Please sign in to comment.