After this change, each handler will create a new db session when it is
instantiated, this is to avoid caching a lot of records in the global
db.session while consumer is running.
Handler should use its own db session after this change, frontend still
uses the global db.session, and APIs provided by models.py now requires
a db session param when any db operation is performed in the API.
After this change, each handler will create a new db session when it is
instantiated, this is to avoid caching a lot of records in the global
db.session while consumer is running.
Handler should use its own db session after this change, frontend still
uses the global db.session, and APIs provided by models.py now requires
a db session param when any db operation is performed in the API.