Commit f75dd529 authored by Elger Jonker's avatar Elger Jonker

remove rebuild ratings button, order workers, refresh more often

parent 2cb2689e
Pipeline #35110754 passed with stage
in 15 minutes and 58 seconds
......@@ -79,12 +79,6 @@ class CustomIndexDashboard(ResetUserWidgetConfiguration, Dashboard):
order=1
))
self.children.append(dashboard_modules.RebuildRatings(
_('Rebuild Ratings'),
column=0,
order=0
))
self.children.append(dashboard_modules.TaskProcessing(
_('Task Processing Status (WIP)'),
column=0,
......
from django.conf.urls import url
from django.contrib import messages
from django.http import JsonResponse
from django.shortcuts import redirect
from django.urls import reverse
from jet.dashboard import dashboard
from failmap.map import rating
from ..celery import PRIO_HIGH, status
from .models import Job
from ..celery import status
def task_processing_status(request):
......@@ -24,27 +18,3 @@ dashboard.urls.register_urls([
name='task-processing-status'
),
])
def rebuild_ratings(request):
"""Create rebuild ratings task and dispatch using a Job to allow the user to track progress."""
name = 'Rebuild ratings'
# create a Task signature for rebuilding ratings, wrap this inside a Job
# to have it trackable by the user in the admin interface
task = rating.compose_task()
job = Job.create(task, name, request, priority=PRIO_HIGH)
# tell the user where to find the Job that was just created
link = reverse('admin:app_job_change', args=(job.id,))
messages.success(request, '%s: job created, id: <a href="%s">%s</a>' % (name, link, str(job)))
return redirect(reverse('admin:index'))
dashboard.urls.register_urls([
url(
r'^rebuild_ratings/',
rebuild_ratings,
name='rebuild-ratings'
),
])
<form method="GET" action="{% url "jet-dashboard:rebuild-ratings" %}">
<p style="padding: 10px; ">
Rebuilding ratings can take up 10 minutes or longer. Be patient.
</p>
<button type="submit" class="rainbow"
style="font-size: 30px;
height: 57px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 10px;
padding: 10px;
color: fuchsia;
background-color: #d0dbe6;
width: calc(100% - 20px);
border: 3px solid fuchsia; ">🌈 Rebuild Ratings 🦄</button>
</form>
......@@ -47,7 +47,7 @@
// periodic poll update
setInterval(function () {
this.update();
}.bind(this), 10000);
}.bind(this), 4200);
},
methods: {
update (){
......
......@@ -112,6 +112,8 @@ def status():
'concurrency': worker_stats['pool']['max-concurrency'],
} for worker_name, worker_stats in stats.items()]
workers = sorted(workers, key=lambda k: (k['name']), reverse=False)
if 'redis://' in app.conf.broker_url:
queue_names = [q.name for q in QUEUES_MATCHING_ROLES['queuemonitor']]
......@@ -143,6 +145,8 @@ def status():
else:
raise NotImplementedError('Currently only Redis is supported!')
queues = sorted(queues, key=lambda k: (k['name']), reverse=False)
alerts = []
if not workers:
alerts.append('No active workers!')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment