state edit

This commit is contained in:
qiaofeng1227 2023-06-19 15:13:46 +08:00
parent 4b94da339b
commit fbe77d2cde
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ COPY static ./static
COPY requirements.txt main.py ./
RUN apt update
# Install supervisord
# Install supervisords
RUN apt install -y supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/cmd.sh /cmd.sh

View file

@ -59,13 +59,13 @@ def AppAutoUpdate(auto_update):
myLogger.info_logger(scheduler.state)
myLogger.info_logger(scheduler.get_jobs())
if auto_update:
if scheduler.state == EVENT_SCHEDULER_RESUMED or scheduler.state == EVENT_SCHEDULER_STARTED:
if scheduler.state == "1":
raise CommandException(const.ERROR_CLIENT_PARAM_REPEAT,"auto_update already in running state", "auto_update already in running state")
else:
scheduler.resume()
return "软件商店自动更新已经开启"
else:
if scheduler.state == EVENT_SCHEDULER_PAUSED:
if scheduler.state == "2":
raise CommandException(const.ERROR_CLIENT_PARAM_REPEAT,"auto_update already in closed state", "auto_update already in closed state")
else:
scheduler.pause()