Replies: 2 comments
|
Seems it's picking up my source files as changing when Python reads them: I'm already using |
|
That is a bug in taskiq, and your log line shows the cause. Reading a file (which It was fixed in #568 ("Fixed reload-loop"), which first shipped in taskiq 0.12.2. The watcher now skips that event too: Lines 46 to 49 in 07d272a So upgrading should be enough. Your command can stay as it is: pip install -U "taskiq>=0.12.2"
taskiq worker src.modules.admin.tasks:broker --reload --reload-dir src/modules/admin --fs-discover --tasks-pattern "*tasks.py"Also, If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm running the latest version of taskiq in a docker container and I can't seem to get a configuration that works nicely for hot reload. Currently I'm using the following in my docker-compose:
command: taskiq worker src.modules.admin.tasks:broker --reload --reload-dir "src/modules/admin" --fs-discover --tasks-pattern "*tasks.py"This seems to put the worker into an infinite reload cycle as soon as it starts. Note that I can't see any file changes being made in those directories. There are no .pycache or .pyc files in any of those folders (checked recursively).
When I watch one level deeper ("src/modules/admin/some_folder_with_tasks") it avoids the reload loop but I do need it to watch my whole admin folder. Any ideas how to figure out what's causing it to reload loop?
edit: Removing "--fs-discover" seems to prevent the issue as well. Perhaps that's the cause? In any case I really prefer using that flag as opposed to manually registering tasks.
All reactions