Skip to content

Commit

Permalink
Add data source health monitoring via an extension.
Browse files Browse the repository at this point in the history
Refs: #379, #415
  • Loading branch information
Marina Samuel authored and jezdez committed Sep 6, 2018
1 parent 09a22f1 commit d9a0fa3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion redash/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_queues_status():
'data_sources': ', '.join(sources),
'size': redis_connection.llen(queue)
}

queues['celery'] = {
'size': redis_connection.llen('celery'),
'data_sources': ''
Expand Down
7 changes: 7 additions & 0 deletions redash/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ def __call__(self, *args, **kwargs):
def init_celery_flask_app(**kwargs):
app = create_app()
app.app_context().push()

@celery.on_after_configure.connect
def add_periodic_tasks(sender, **kwargs):
app = create_app()
periodic_tasks = getattr(app, 'periodic_tasks', {})
for params in periodic_tasks.values():
sender.add_periodic_task(**params)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ disposable-email-domains
# Uncomment the requirement for ldap3 if using ldap.
# It is not included by default because of the GPL license conflict.
# ldap3==2.2.4
redash-stmo>=2018.4.0
redash-stmo>=2018.8.1

0 comments on commit d9a0fa3

Please sign in to comment.