<s> from celery . schedules import crontab <EOL> from celery . task . base import periodic_task <EOL> from corehq . apps . callcenter . indicator_sets import CallCenterIndicators <EOL> from corehq . apps . callcenter . utils import get_call_center_domains , is_midnight_for_domain , get_call_center_cases <EOL> from celery . utils . log import get_task_logger <EOL> logger = get_task_logger ( __name__ ) <EOL> @ periodic_task ( run_every = crontab ( minute = '<STR_LIT>' ) , queue = '<STR_LIT>' ) <EOL> def calculate_indicators ( ) : <EOL> """<STR_LIT>""" <EOL> domains = [ <EOL> domain <EOL> for domain in get_call_center_domains ( ) <EOL> for midnight in domain . midnights ( ) <EOL> if is_midnight_for_domain ( midnight , error_margin = <NUM_LIT:20> ) and domain . use_fixtures <EOL> ] <EOL> logger . info ( "<STR_LIT>" . format ( domains ) ) <EOL> for domain in domains : <EOL> all_cases = get_call_center_cases ( domain . name , domain . cc_case_type ) <EOL> indicator_set = CallCenterIndicators ( <EOL> domain . name , <EOL> domain . default_timezone , <EOL> domain . cc_case_type , <EOL> user = None , <EOL> override_cases = all_cases , <EOL> override_cache = True <EOL> ) <EOL> indicator_set . get_data ( ) </s>
