Skip to content

Commit

Permalink
avoid loading entire job data for queued jobs (#4257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Lachish authored and arikfr committed Oct 23, 2019
1 parent 6128334 commit f0f85ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions client/app/pages/admin/Jobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion redash/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}


Expand Down

0 comments on commit f0f85ec

Please sign in to comment.