10👍
✅
I found the solution to the problem. It’s not a Heroku timeout because otherwise there would be a H12 timeout in the Heroku log (thanks to Caio of Heroku to point that out).
The problem was the default timeout of Gunicorn wich is 30 seconds. After adding –timeout 600 to the Procfile (at the line of Gunicorn) the problem was gone.
The Procfile now looks like this:
web: gunicorn myapp.wsgi -b 0.0.0.0:$PORT --timeout 600
celeryd: python manage.py celeryd -E -B --loglevel=INFO
👤Tom
1👍
That’s rather not the problem of your script, but the problem of 30 seconds web request default Heroku timeout.
You could read this:
https://devcenter.heroku.com/articles/request-timeout
and according to this doc – move your CSV export to background process.
- Django 3.1+: (fields.E180) SQLite does not support JSONFields
- How to serialize custom user model in DRF
- Performance comparison of using django signed cookie session over django db + cache based session?
- Django – How can I display a photo saved in ImageField?
- AttributeError : 'NoneType' object has no attribute '_meta'
Source:stackexchange.com