Show import queue in Celery admin

This commit is contained in:
Mouse Reeve 2023-01-26 07:52:37 -08:00
parent 9c3c34834f
commit ef48149844
2 changed files with 10 additions and 3 deletions

View file

@ -13,24 +13,30 @@
<section class="block content"> <section class="block content">
<h2>{% trans "Queues" %}</h2> <h2>{% trans "Queues" %}</h2>
<div class="columns has-text-centered"> <div class="columns has-text-centered">
<div class="column is-4"> <div class="column is-3">
<div class="notification"> <div class="notification">
<p class="header">{% trans "Low priority" %}</p> <p class="header">{% trans "Low priority" %}</p>
<p class="title is-5">{{ queues.low_priority|intcomma }}</p> <p class="title is-5">{{ queues.low_priority|intcomma }}</p>
</div> </div>
</div> </div>
<div class="column is-4"> <div class="column is-3">
<div class="notification"> <div class="notification">
<p class="header">{% trans "Medium priority" %}</p> <p class="header">{% trans "Medium priority" %}</p>
<p class="title is-5">{{ queues.medium_priority|intcomma }}</p> <p class="title is-5">{{ queues.medium_priority|intcomma }}</p>
</div> </div>
</div> </div>
<div class="column is-4"> <div class="column is-3">
<div class="notification"> <div class="notification">
<p class="header">{% trans "High priority" %}</p> <p class="header">{% trans "High priority" %}</p>
<p class="title is-5">{{ queues.high_priority|intcomma }}</p> <p class="title is-5">{{ queues.high_priority|intcomma }}</p>
</div> </div>
</div> </div>
<div class="column is-3">
<div class="notification">
<p class="header">{% trans "Imports" %}</p>
<p class="title is-5">{{ queues.imports|intcomma }}</p>
</div>
</div>
</div> </div>
</section> </section>
{% else %} {% else %}

View file

@ -36,6 +36,7 @@ class CeleryStatus(View):
"low_priority": r.llen("low_priority"), "low_priority": r.llen("low_priority"),
"medium_priority": r.llen("medium_priority"), "medium_priority": r.llen("medium_priority"),
"high_priority": r.llen("high_priority"), "high_priority": r.llen("high_priority"),
"imports": r.llen("imports"),
} }
# pylint: disable=broad-except # pylint: disable=broad-except
except Exception as err: except Exception as err: