django-postgres-queue icon indicating copy to clipboard operation
django-postgres-queue copied to clipboard

Run worker with django autoreloader by default

Open Majsvaffla opened this issue 2 years ago • 5 comments
trafficstars

I thought it would be a neat addition to support auto-reload like django-admin runserver does. That is usually what you want while developing.

Majsvaffla avatar May 11 '23 16:05 Majsvaffla

Good idea, but I don't think it should be the default

gavinwahl avatar Oct 06 '23 16:10 gavinwahl

Good idea, but I don't think it should be the default

Fair enough :)

I've also been thinking of adding support for watchfiles. Having more reloader options also promotes not having a default I think.

Majsvaffla avatar Oct 07 '23 10:10 Majsvaffla

If autoreloading is already in Django, what's the point of using something else?

gavinwahl avatar Oct 10 '23 21:10 gavinwahl

It's a bit hacky to hook into the Django autoreloader since it's not really designed for that. Watchfiles also performs better than the reloader mechanism built into Django from my experience.

Majsvaffla avatar Oct 12 '23 08:10 Majsvaffla

I've changed it to opt-in as you proposed 🙂 Use --reload to enable autoreload.

Regarding watchfiles, I guess this would use watchfiles implicitly if the django project were using django-watchfiles.

Majsvaffla avatar Oct 24 '23 07:10 Majsvaffla