Open rehbarkhan opened 7 months ago
would you mind checking this please https://stackoverflow.com/questions/25451087/django-select-for-update-cannot-be-used-outside-of-a-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