Browse Source

auto—_update condition

qiaofeng1227 2 years ago
parent
commit
c903ce010c
2 changed files with 6 additions and 2 deletions
  1. 1 1
      appmanage/Dockerfile
  2. 5 1
      appmanage/api/service/manage.py

+ 1 - 1
appmanage/Dockerfile

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

+ 5 - 1
appmanage/api/service/manage.py

@@ -36,8 +36,12 @@ q = Queue(connection=redis_conn, default_timeout=3600)
 def auto_update():
 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")
     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")
 
 
+def test():
+    shell_execute.execute_command_output_all("echo 1111 >> /tmp/test1")
+
 scheduler = BackgroundScheduler()
 scheduler = BackgroundScheduler()
-scheduler.add_job(auto_update, IntervalTrigger(minutes=1))
+scheduler.add_job(auto_update, 'cron', second=1)
+scheduler.add_job(test, 'cron', second=1)
 
 
 # 获取github文件内容
 # 获取github文件内容
 def get_github_content(repo, path):
 def get_github_content(repo, path):