浏览代码

auto_update

qiaofeng1227 2 年之前
父节点
当前提交
c67111bdda
共有 6 个文件被更改,包括 20 次插入16 次删除
  1. 1 1
      .github/workflows/appmanage_docker.yml
  2. 4 0
      CHANGELOG.md
  3. 1 1
      appmanage/Dockerfile
  4. 11 11
      appmanage/api/service/manage.py
  5. 1 1
      docker/w9appmanage/.env
  6. 2 2
      install/version.json

+ 1 - 1
.github/workflows/appmanage_docker.yml

@@ -22,7 +22,7 @@ jobs:
         name: Build & push Docker image
         with:
           image: websoft9dev/appmanage
-          tags: 0.7.1
+          tags: 0.7.2
           registry: docker.io
           dockerfile: appmanage/Dockerfile
           directory: appmanage

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+## 0.7.2 release on 2023-06-25
+
+appmanage 自动更新接口升级
+
 ## 0.7.1 release on 2023-06-21
 
 appmanage version 文件意外删除时 bug 修改  

+ 1 - 1
appmanage/Dockerfile

@@ -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

+ 11 - 11
appmanage/api/service/manage.py

@@ -54,18 +54,18 @@ def AppAutoUpdate(auto_update):
 
     myLogger.info_logger(scheduler.state)
     myLogger.info_logger(scheduler.get_jobs())
-    if auto_update:
-        if scheduler.state == "1":
-            raise CommandException(const.ERROR_CLIENT_PARAM_REPEAT,"auto_update already in running state", "auto_update already in running state")
+    if auto_update == "true" or auto_update == "True":
+        scheduler.resume()
+        return "true"
+    elif auto_update == "false" or auto_update == "False":
+        scheduler.pause()
+        return "false"
+    elif auto_update == None or auto_update == "" or auto_update == "undefine":
+        state = scheduler.state
+        if state == 1:
+          return "true"
         else:
-            scheduler.resume()
-            return "软件商店自动更新已经开启"
-    else:
-        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()
-            return "软件商店自动更新已经关闭"
+          return "false"
 
 # 更新软件商店
 def AppStoreUpdate():

+ 1 - 1
docker/w9appmanage/.env

@@ -1,4 +1,4 @@
 APP_NAME=websoft9-appmanage
-APP_VERSION=0.7.1
+APP_VERSION=0.7.2
 APP_HTTP_PORT=5000
 APP_NETWORK=websoft9

+ 2 - 2
install/version.json

@@ -2,8 +2,8 @@
     "SERVICES": {
         "PORTAINER": "2.18.3",
         "NGINX": "2.10.3",
-        "APPMANAGE": "0.7.1",
+        "APPMANAGE": "0.7.2",
         "REDIS": "7.0.11"
     },   
-    "VERSION": "0.7.1"
+    "VERSION": "0.7.2"
 }