smswithoutborders / SMSWithoutBorders-BE-Publisher

GNU General Public License v3.0
4 stars 0 forks source link

[staging] Database connection goes away #3

Closed sherlockwisdom closed 1 year ago

sherlockwisdom commented 1 year ago

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

PromiseFru commented 1 year ago

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.