Open daniboygg opened 2 weeks ago
You would have to rewrite the db_worker
command to use Django's autoreload. It's not default Python behavior.
This is indeed expected behaviour, although not "intended" necessarily. Only Django's runserver
command reloads when the code does. Other long-running management commands don't.
I agree it'd be a nice feature to have, but the behaviour could be quite complex. For example, what happens if a task is running?
I was testing this package and created a Django admin action to trigger the enqueue of a task. After getting everything working, I changed the code to modify the task result. However, after queuing the task, I still got the old result.
My guess is that when running the
db_worker
, you need to restart the command if you change the code. Is this expected behavior? I was surprised because I'm used to Django'srunserver
restarting on code changes. Could be a good idea to document this in the README?