improve schedule

This commit is contained in:
qiaofeng1227 2023-06-19 10:34:20 +08:00
parent 5ab8a8def5
commit 7ee40dc5aa
2 changed files with 5 additions and 5 deletions
appmanage

View file

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

View file

@ -37,9 +37,7 @@ def auto_update():
shell_execute.execute_command_output_all("wget https://websoft9.github.io/StackHub/install/update_appstore.sh && bash update_appstore.sh 1>/dev/null 2>&1")
scheduler = BackgroundScheduler()
#scheduler.add_job(auto_update, CronTrigger(hour=1, minute=0))
scheduler.add_job(auto_update, IntervalTrigger(minutes=1))
#scheduler.shutdown()
scheduler.add_job(auto_update, CronTrigger.from_crontab('36 * * * * *'), id='auto_update_job')
# 获取github文件内容
def get_github_content(repo, path):
@ -51,7 +49,9 @@ def get_github_content(repo, path):
return contents
def AppAutoUpdate(auto_update):
myLogger.info_logger(scheduler.state)
myLogger.info_logger(scheduler.get_jobs())
if auto_update:
scheduler.start()
return "软件商店自动更新已经开启"