def del_sqlcronjob(job_id): try: sql_schedule = Schedule.objects.get(name=job_id) Schedule.delete(sql_schedule) logger.debug('del_sqlcronjob:' + job_id) except Schedule.DoesNotExist: logger.debug('del_sqlcronjob {} failed, job does not exist'.format(job_id))
def del_schedule(name): """删除task""" try: sql_schedule = Schedule.objects.get(name=name) Schedule.delete(sql_schedule) # logger.debug(f'删除task:{name}') except Schedule.DoesNotExist: pass