Skip to content

Commit

Permalink
fix: 修改FunctionSwitch.DoesNotExist报错问题 TencentBlueKing#1464
Browse files Browse the repository at this point in the history
  • Loading branch information
huangpixu committed Jan 21, 2025
1 parent c102f38 commit 9b36520
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pipeline/engine/models/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def init_db(self):
logger.error("function switch init failed: %s" % traceback.format_exc())

def is_frozen(self):
return self.get(name=function_switch.FREEZE_ENGINE).is_active
try:
is_frozen = self.get(name=function_switch.FREEZE_ENGINE).is_active
except FunctionSwitch.DoesNotExist:
is_frozen = None
return is_frozen

def freeze_engine(self):
self.filter(name=function_switch.FREEZE_ENGINE).update(is_active=True)
Expand Down

0 comments on commit 9b36520

Please sign in to comment.