dropik / receipt-scan-serverless

Serverless AWS application for receipt scan
0 stars 0 forks source link

Server has gone away #1

Closed dropik closed 4 months ago

dropik commented 4 months ago

After a bit of idle time of apparently active lambda, server has gone away error kicks in when trying to do any operation on database.

dropik commented 4 months ago

Quick research shows that MySql might be closing connection. Probably the most reliable way to solve this is to introduce scoped services and resolve db connection as a such service.

dropik commented 4 months ago

Actually instead of reconnecting on each request, there is option to reconnect automatically. Repository is singleton again.