From 421eecd0ea3b776c0424118619f67d23aa7a3e15 Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Fri, 24 Jul 2015 14:57:33 +0200 Subject: [PATCH 1/2] monitor TQ will indicate green when `queue_limit` has been reached. --- django_q/monitor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/django_q/monitor.py b/django_q/monitor.py index 02d6a59..e7d3a99 100644 --- a/django_q/monitor.py +++ b/django_q/monitor.py @@ -53,9 +53,11 @@ def monitor(run_once=False): elif stat.status == Conf.IDLE: status = str(Conf.IDLE) # color q's - tasks = stat.task_q_size - if tasks > 0: - tasks = term.cyan(str(tasks)) + tasks = str(stat.task_q_size) + if stat.task_q_size > 0: + tasks = term.cyan(str(stat.task_q_size)) + if Conf.QUEUE_LIMIT and stat.task_q_size == Conf.QUEUE_LIMIT: + tasks = term.green(str(stat.task_q_size)) results = stat.done_q_size if results > 0: results = term.cyan(str(results)) From ac41d50bf2cbcce3f23ab44f81810d89f62498b2 Mon Sep 17 00:00:00 2001 From: Ilan Date: Fri, 24 Jul 2015 20:47:35 +0200 Subject: [PATCH 2/2] adds group filter to admin --- django_q/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_q/admin.py b/django_q/admin.py index 2f80ade..3fbfdce 100644 --- a/django_q/admin.py +++ b/django_q/admin.py @@ -26,6 +26,7 @@ class TaskAdmin(admin.ModelAdmin): search_fields = ('name', 'func', 'group') readonly_fields = [] + list_filter = ('group',) def get_readonly_fields(self, request, obj=None): return list(self.readonly_fields) + \ @@ -56,6 +57,7 @@ class FailAdmin(admin.ModelAdmin): actions = [retry_failed] search_fields = ('name', 'func') + list_filter = ('group',) readonly_fields = [] def get_readonly_fields(self, request, obj=None):