def weekly_reports(): # this should get called every hour by celery now = datetime.utcnow() reps = DailyReportNotification.view("reports/weekly_notifications", key=[now.weekday(), now.hour], include_docs=True).all() _run_reports(reps)
def daily_reports(): # this should get called every hour by celery reps = DailyReportNotification.view("reports/daily_notifications", key=datetime.utcnow().hour, include_docs=True).all() _run_reports(reps)