mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-05-31 22:58:18 +00:00
b167364c5c
I think this will go a long way to solve the federation delay problems we're seeing on b.s. I'm not sure at what point adding more queues will create more problems than it solves, but I do think in this case the queues are out of balance and moving broadcasts (which are the most common type of `medium_priority` task at the moment) to their own queue will be an improvement.
130 lines
3.9 KiB
HTML
130 lines
3.9 KiB
HTML
{% extends 'settings/layout.html' %}
|
|
{% load humanize %}
|
|
{% load i18n %}
|
|
{% load celery_tags %}
|
|
|
|
{% block title %}{% trans "Celery Status" %}{% endblock %}
|
|
|
|
{% block header %}{% trans "Celery Status" %}{% endblock %}
|
|
|
|
{% block panel %}
|
|
|
|
<div class="notification">
|
|
<p>
|
|
{% trans "You can set up monitoring to check if Celery is running by querying:" %}
|
|
{% url "settings-celery-ping" as url %}
|
|
<a href="{{ url }}" target="_blank" rel="nofollow noopener noreferrer">{{ url }}</a>
|
|
</p>
|
|
</div>
|
|
|
|
{% if queues %}
|
|
<section class="block content">
|
|
<h2>{% trans "Queues" %}</h2>
|
|
<div class="columns has-text-centered is-multiline">
|
|
<div class="column is-4">
|
|
<div class="notification">
|
|
<p class="header">{% trans "Low priority" %}</p>
|
|
<p class="title is-5">{{ queues.low_priority|intcomma }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="column is-4">
|
|
<div class="notification">
|
|
<p class="header">{% trans "Medium priority" %}</p>
|
|
<p class="title is-5">{{ queues.medium_priority|intcomma }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="column is-4">
|
|
<div class="notification">
|
|
<p class="header">{% trans "High priority" %}</p>
|
|
<p class="title is-5">{{ queues.high_priority|intcomma }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="column is-6">
|
|
<div class="notification">
|
|
<p class="header">{% trans "Imports" %}</p>
|
|
<p class="title is-5">{{ queues.imports|intcomma }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="column is-6">
|
|
<div class="notification">
|
|
<p class="header">{% trans "Broadcasts" %}</p>
|
|
<p class="title is-5">{{ queues.broadcast|intcomma }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% else %}
|
|
<div class="notification is-danger is-flex is-align-items-start">
|
|
<span class="icon icon-warning is-size-4 pr-3" aria-hidden="true"></span>
|
|
<span>
|
|
{% trans "Could not connect to Redis broker" %}
|
|
</span>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if stats %}
|
|
<section class="block content">
|
|
<h2>{% trans "Active Tasks" %}</h2>
|
|
{% for worker in active_tasks.values %}
|
|
<div class="table-container">
|
|
<table class="table is-striped is-fullwidth">
|
|
<tr>
|
|
<th>{% trans "ID" %}</th>
|
|
<th>{% trans "Task name" %}</th>
|
|
<th>{% trans "Run time" %}</th>
|
|
<th>{% trans "Priority" %}</th>
|
|
</tr>
|
|
{% if not worker %}
|
|
<tr>
|
|
<td colspan="4">
|
|
<em>{% trans "No active tasks" %}</em>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% for task in worker %}
|
|
<tr>
|
|
<td>{{ task.id }}</td>
|
|
<td>{{ task.name|shortname }}</td>
|
|
<td>{{ task.time_start|runtime }}</td>
|
|
<td>{{ task.delivery_info.routing_key }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endfor %}
|
|
</section>
|
|
|
|
<section class="block content">
|
|
<h2>{% trans "Workers" %}</h2>
|
|
|
|
{% for worker_name, worker in stats.items %}
|
|
<div class="notification">
|
|
<h3>{{ worker_name }}</h3>
|
|
{% trans "Uptime:" %} {{ worker.uptime|uptime }}
|
|
</div>
|
|
{% endfor %}
|
|
</section>
|
|
|
|
{% else %}
|
|
|
|
<div class="notification is-danger is-flex is-align-items-start">
|
|
<span class="icon icon-warning is-size-4 pr-3" aria-hidden="true"></span>
|
|
<span>
|
|
{% trans "Could not connect to Celery" %}
|
|
</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if errors %}
|
|
<div class="block content">
|
|
<h2>{% trans "Errors" %}</h2>
|
|
{% for error in errors %}
|
|
<pre>{{ error }}</pre>
|
|
{% endfor %}
|
|
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|