fix(DailyRecipe generate_recipe): [M] 修复获取随机菜谱时死循环的问题
[M] 修复获取随机菜谱时死循环的问题 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
6887140a4e
commit
d2d6af2cca
@ -55,6 +55,8 @@ class DailyRecipe(models.Model):
|
|||||||
if recipe and recipe.id not in recipes and recipe.id not in prev_recipes:
|
if recipe and recipe.id not in recipes and recipe.id not in prev_recipes:
|
||||||
recipes.append(recipe.id)
|
recipes.append(recipe.id)
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
retry -= 1
|
||||||
if retry <= 0:
|
if retry <= 0:
|
||||||
retry = 5
|
retry = 5
|
||||||
break
|
break
|
||||||
@ -68,7 +70,8 @@ class DailyRecipe(models.Model):
|
|||||||
if recipe and recipe.id not in recipes and recipe.id not in prev_recipes:
|
if recipe and recipe.id not in recipes and recipe.id not in prev_recipes:
|
||||||
recipes.append(recipe.id)
|
recipes.append(recipe.id)
|
||||||
break
|
break
|
||||||
retry -= 1
|
else:
|
||||||
|
retry -= 1
|
||||||
if retry <= 0:
|
if retry <= 0:
|
||||||
retry = 5
|
retry = 5
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user