fix: 清理错误定时策略并支持生成cron文本3
This commit is contained in:
parent
51acf6caa0
commit
4375c344e9
|
@ -36,12 +36,16 @@ def correct_myschedule():
|
|||
elif typeset == 'crontab':
|
||||
try:
|
||||
crontab = item.crontab
|
||||
if crontab:
|
||||
item.name = get_chinese_description(typeset,
|
||||
{"minute": crontab.minute, "hour": crontab.hour, "day_of_month": crontab.day_of_month,
|
||||
"month_of_year": crontab.month_of_year, "day_of_week": crontab.day_of_week})
|
||||
if item.name == '':
|
||||
crontab.delete()
|
||||
item.delete()
|
||||
else:
|
||||
PeriodicTask.objects.filter(gridtaskset_periodictask__myschedule=item).delete()
|
||||
item.delete()
|
||||
except ObjectDoesNotExist:
|
||||
GridTaskSet.objects.filter(myschedule=item).delete()
|
||||
item.delete()
|
Loading…
Reference in New Issue