feat: Add worker --reload
option
#24
Replies: 1 comment 1 reply
-
(I'm going to try moving these to discussions so I can leave them open without cluttering issues...) I will try to do more documentation on the worker soon — kudos for figuring some of this out on your own! I do something similar myself and just documented that here: [tool.plain.dev.run]
worker = {cmd = "plain models db-wait && watchfiles --filter python \"plain worker run --stats-every 0 --max-processes 2\" ."}
worker-slow = {cmd = "plain models db-wait && watchfiles --filter python \"plain worker run --queue slow --stats-every 0 --max-processes 2\" ."} I agree that from a "batteries included" approach it could be nice to build this in. On the web server itself, we're just relying on the gunicorn feature for reloading so I haven't actually had to decide if or how to handle this yet (or what dependency to trust, etc). I'm going to leave it as a documentation solution for now but will definitely keep this in mind — for both this and #25 it would obviously be much nicer to do |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
In contrast to the web server, these is no option for the worker to reload on code changes. Incorporating this would speed up development and prevent a lot of manual rebooting the
plain dev
command.Current workaround
Watchdog to facilitate this, but it feels like the frameworks setup would be to provide it 'batteries included'.
Proposed solution
Having a
--reload
option for the worker run command that does the reloading for us (e.g.plain worker run --reload
). Maybe even let it be the default if going for convention over configuration.Beta Was this translation helpful? Give feedback.
All reactions