I have multiprocessing running and at the end of each task I update the database with a status.
I do the save like this
def save(self, *args, **kwargs):
super(ShopPushQueue, self).save(*args, **kwargs)
I get the following error though
DatabaseError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/var/www/venv/local/lib/python2.7/site-
packages/django/db/models/sql/compiler.py", line 894, in execute_sql
raise original_exception
OperationalError: SSL SYSCALL error: EOF detected
I think I get that the connection is no longer available, but I don't understand why. This works well when not using multiprocessing.
Is there something I should be doing to refresh the database connection? Or maintain it
Thanks