@periodic_task(
    run_every=crontab(minute=1, hour="*/6"),
    queue=getattr(settings, 'CELERY_PERIODIC_QUEUE', 'celery')
)
def new_update_case_properties():
    for case, domain in iter_cases_to_modify():
        kwargs = {
            'create': False,
            'case_id': case['case_id'],
            'update': case['update'],
            'close': case['close'],
        }
        if case.get('owner_id', None):
            kwargs['owner_id'] = case['owner_id']
        submit_case_blocks([ElementTree.tostring(CaseBlock(**kwargs).as_xml())], domain)
Submit one case-block per case update deliberately instead of bulk update so that
dataset/ETHPy150Open dimagi/commcare-hq/custom/_legacy/hsph/tasks.py/new_update_case_properties