https://blog.soshace.com/implementing-a-backgroundrunner-with-flask-executor/