I have a Python program which runs on background for weeks, and does database queries every once in a while. For that, I am using the ORM peewee (version 2.2.1). I am using
I have resolved this issue.
My solution is use mysql connection pool PooledMySQLDatabase from playhouse.pool module.
PooledMySQLDatabase
playhouse.pool
please read: https://github.com/coleifer/peewee/issues/239
from peewee import * from playhouse.pool import *