Skip to content

Instantly share code, notes, and snippets.

@avivl
Last active February 4, 2018 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avivl/f2df757c2af0f553e37e2facb63ebefa to your computer and use it in GitHub Desktop.
Save avivl/f2df757c2af0f553e37e2facb63ebefa to your computer and use it in GitHub Desktop.
@app.route('/tasks/check-load')
def check_load():
"""Entry point for cron task that launches a task for each cluster
check cluster stats"""
clusters = settings.get_all_clusters_settings()
for cluster in clusters.iter():
task = taskqueue.add(queue_name='shamash',
url="/monitors",
method='GET',
params={'cluster_name': cluster.Cluster})
logging.debug('Task %s enqueued, ETA %s.', task.name, task.eta)
return 'ok', 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment