Skip to content

Instantly share code, notes, and snippets.

@avivl
Last active Feb 4, 2018
Embed
What would you like to do?
@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