Skip to content

Instantly share code, notes, and snippets.

Last active February 4, 2018 06:56
What would you like to do?
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',
params={'cluster_name': cluster.Cluster})
logging.debug('Task %s enqueued, ETA %s.',, task.eta)
return 'ok', 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment