Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor general RQ queues (default, periodic and schemas) #4256

Merged
merged 4 commits into from
Oct 23, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion redash/monitor.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,8 @@ def get_queues():
scheduled_queue_names = db.session.query(DataSource.scheduled_queue_name).distinct()
query = db.session.execute(union_all(queue_names, scheduled_queue_names))

return ['celery'] + [row[0] for row in query]
general_rq_queues = map(lambda q: 'rq:queue:' + q, ['default', 'periodic', 'schemas'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the rq:queue: prefix?

Also, is there a way to ask rq for all the active queues?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, is it because that's the Redis key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yupp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is there a way to ask rq for all the active queues?

Yeah, I refactored it and now it reports all queues (on the way, it made sense to remove the rq:queue: prefix due to not poking directly in Redis anymore).

return ['celery'] + general_rq_queues + [row[0] for row in query]


def get_queues_status():