You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
django-celery-results is not able to save the tasks results, getting below error. :
{"exc_type": "TransactionManagementError", "exc_message": ["select_for_update cannot be used outside of a transaction."], "exc_module": "django.db.transaction"}
I have tried this, but it didn't work.
I went to the django-celery-results code base and updated the blow code
def on_chord_part_return(self, request, state, result, **kwargs):
"""Called on finishing each part of a Chord header"""
tid, gid = request.id, request.group
if not gid or not tid:
return
call_callback = False
with transaction.atomic():
# We need to know if `count` hits 0.
# wrap the update in a transaction
with
def on_chord_part_return(self, request, state, result, **kwargs):
"""Called on finishing each part of a Chord header"""
tid, gid = request.id, request.group
if not gid or not tid:
return
call_callback = False
with transaction.atomic(using = 'production_db'):
# We need to know if `count` hits 0.
# wrap the update in a transaction
I have passed using='production_db' to atomic method.
After making these changes, results are getting stored in the django database however after 30 to 40mins, celery is exiting automatically.
django-celery-results is not able to save the tasks results, getting below error. :
My App Config:
My database config:
I have tried to enable "ATOMIC_REQUESTS: True" but no luck, still getting the TransactionManagementError
The text was updated successfully, but these errors were encountered: