I am new to web development, and I keep having an issue getting my server to 'stay'. The issue in the title occurs every time I try to load the site after about 5 minutes of inactivity. Right now I am using pymysql, but the other people having this issue appear to be using sqlalchemy, so I haven't been able to figure out a solution from those posts. Is there a way to reset the pool recycle so that I do not have this issue anymore? Here are my input statements at the top of my .py file, for clarity.
from app import app
from collections import namedtuple
from flask import Flask, request, render_template, session, redirect, url_for, flash, redirect
import pymysql
import pymysql.cursors
db = pymysql.connect(host='host',
db='database',
user='ryanpe05',
password='pass',
cursorclass=pymysql.cursors.DictCursor)