A long running task can keeps running after a hot reload, which can be confusing. In our case we had a lot of SQLAlchemy errors because we had old and new classes being mixed. Crucial here is to detect if we did a hot reload, or if the current task is still running (the latter should be enough if it did not crash)