I would advise moving to a proper environment, but the best option really depends on what exactly the method you are calling is supposed to do. You can implement a thread lock so that the 'reload' thread will not run ready() you can move to a production environment to run your server (Gunicorn for example is very quick to setup, even for testing) or you can call your method in another way rather than using ready(). If you have code that can not be run in both of these threads then your options are somewhat limited. The 'main' thread loads the AppConfig files as part of it's BaseCommand execute, and the 'reload' thread then load them again during it's startup of the server. Add a print statement to the module and you will see this in action.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |