Fix to the problem of apache server going down due to sqlalchemy session pool limit problem as a result of running background scheduled tasks.