Skip to content

Instantly share code, notes, and snippets.

@dcramer
Created May 30, 2013 23:25
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 dcramer/5682052 to your computer and use it in GitHub Desktop.
Save dcramer/5682052 to your computer and use it in GitHub Desktop.
from datetime import timedelta
from celery.task import periodic_task, task
from celery.task.schedules import crontab
from django.utils import timezone
from sentry.constants import MINUTE_NORMALIZATION
from sentry.utils import math
def fsteps(start, stop, steps):
step = (stop - start) / steps
while start <= stop:
yield start
start += step
@periodic_task(
name='sentry.tasks.check_alerts',
run_every=crontab(minute='*'), queue='alerts')
def check_alerts(**kwargs):
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment