# coding=utf-8
# create by esse at 2018/4/18
from celery import shared_task


@shared_task()
def delete_diary_rank(diary_ids):
    from hippo.views.resource_rank import doctor_diary_rank_batch_delete
    for diary_id in diary_ids:
        try:
            doctor_diary_rank_batch_delete.func(diary_id=diary_id)
        except:
            continue


@shared_task()
def delete_service_rank(service_id=None, doctor_id=None):
    try:
        from hippo.views.resource_rank import doctor_service_rank_batch_delete
        doctor_service_rank_batch_delete.func(service_id=service_id, doctor_id=doctor_id)
    except:
        pass
