Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
程浩 committed Apr 11, 2024
1 parent c699aa5 commit 4ec61ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mysql_server_has_gone_away/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def wrapper(self, query, args=None):
except (OperationalError, InterfaceError) as e:
logger.warn("MySQL server has gone away. Rerunning query: %s", query)
if (
'server has gone away' in str(e) or
'MySQL server has gone away' in str(e) or
'Server has gone away' in str(e) or
'Lost connection to MySQL server during query' in str(e)
):
db_wrapper.connection.close()
Expand Down

0 comments on commit 4ec61ac

Please sign in to comment.