Bogdanp / django_dramatiq

A Django app that integrates with Dramatiq.
https://dramatiq.io
Other
331 stars 77 forks source link

Add more Task filters to admin interface #50

Closed jcass77 closed 4 years ago

jcass77 commented 4 years ago

It can be quite difficult to find specific tasks using the admin interface (especially if you have a large number of actors running on a regular basis).

This PR adds filters for the queue_name, actor_name and created_at fields.

I initially tried to get the lookup choices by interrogating the broker using broker.get_declared_actors(), broker.get_declared_queues() and broker.get_declared_delay_queues(), but it seams that those methods only return values for actors and queues that have been declared as part of the current Dramatiq session?

The only alternative that I could think of was to pre-scan the data to produce the list of available choices, which is probably not terribly efficient :(

Bogdanp commented 4 years ago

Thanks! These changes have been merged with rebase. I'll release them sometime in the coming weeks.

Sovetnikov commented 4 years ago

Why not just store task name in database as separate field?