We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9415676 commit bbd7ab9Copy full SHA for bbd7ab9
djcelery/snapshot.py
@@ -136,7 +136,7 @@ def _handle_tasks():
136
except InterfaceError as e:
137
# When connection already closed exception is raised,
138
# force to close connection and Django will automatically reconnect
139
- if str(e) == 'connection already closed':
+ if getattr(e, 'args', None) and 'connection already closed' in e.args[0]:
140
connection.close()
141
logger.info(
142
'Django db connection is closed and will reconnect'
0 commit comments