From b89dc3a4c3137c278785030dca539a7558f98cfa Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 1 Nov 2018 08:11:00 +0100 Subject: [PATCH] start event is called everytime a new step starts. So a new value for "active_brew" will only be generated if the value before was "none". The value is "none" either after initializing the app or after the process got stopped. That leaves one potentiall error: if a process is started and the app needs a restart. In this case a new value for "active_brew" would be unecessarily generated. --- modules/steps/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/steps/__init__.py b/modules/steps/__init__.py index 1189d09..7827c14 100755 --- a/modules/steps/__init__.py +++ b/modules/steps/__init__.py @@ -146,7 +146,8 @@ class StepView(BaseView): @route('/start', methods=['POST']) def start(self): - cbpi.cache["active_brew"] = cbpi.cache["config"]["brew_name"].__dict__["value"] + \ + if "none" == cbpi.cache["active_brew"]: + cbpi.cache["active_brew"] = cbpi.cache["config"]["brew_name"].__dict__["value"] + \ "_" + datetime.datetime.now().strftime('%y-%m-%dT%H:%M') return self.next()