smswithoutborders / SMSWithoutBorders-BE-Publisher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[staging] Database connection goes away

sherlockwisdom opened this issue · comments

When a singleton object is created and reused in the code the error shows up after every transaction

[staging] peewee.OperationalError: (2006, 'MySQL server has gone away')

I think the connection needs to have a dynamic of checking and reopening closed connection.

Other possibilities involve creating the connection at every API call - would go with that while pending more feedback

When a singleton object is created and reused in the code the error shows up after every transaction

[staging] peewee.OperationalError: (2006, 'MySQL server has gone away')

I think the connection needs to have a dynamic of checking and reopening closed connection.

Other possibilities involve creating the connection at every API call - would go with that while pending more feedback

Ah yes I think Peewee mentioned this behavior here. The database connection will have to be closed after every query.