diff --git a/pipeline/engine/models/function.py b/pipeline/engine/models/function.py index d6429e4e..9f31cad2 100644 --- a/pipeline/engine/models/function.py +++ b/pipeline/engine/models/function.py @@ -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)