From 1811c2dc4da6ef6395c0583cdef00bc65b1dd929 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Thu, 17 Oct 2019 13:16:26 +0300 Subject: [PATCH] avoid loading entire job data for queued jobs --- client/app/pages/admin/Jobs.jsx | 5 ++--- redash/monitor.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/app/pages/admin/Jobs.jsx b/client/app/pages/admin/Jobs.jsx index a7e005eb08..44dc6e3bf9 100644 --- a/client/app/pages/admin/Jobs.jsx +++ b/client/app/pages/admin/Jobs.jsx @@ -40,10 +40,9 @@ class Jobs extends React.Component { } processQueues = ({ queues, workers }) => { - const queueCounters = values(queues).map(({ name, started, queued }) => ({ - name, + const queueCounters = values(queues).map(({ started, ...rest }) => ({ started: started.length, - queued: queued.length, + ...rest, })); const overallCounters = queueCounters.reduce( diff --git a/redash/monitor.py b/redash/monitor.py index f0d8abfa1b..406390fbcf 100644 --- a/redash/monitor.py +++ b/redash/monitor.py @@ -155,7 +155,7 @@ def rq_queues(): q.name: { 'name': q.name, 'started': fetch_jobs(q, StartedJobRegistry(queue=q).get_job_ids()), - 'queued': fetch_jobs(q, q.job_ids) + 'queued': len(q.job_ids) } for q in Queue.all(connection=redis_connection)}