not need update appstore check

This commit is contained in:
qiaofeng1227 2023-07-28 11:19:13 +08:00
parent e808de858f
commit f2d05cbca3
2 changed files with 16 additions and 2 deletions

View File

@ -11,7 +11,7 @@ COPY static ./static
COPY requirements.txt main.py database.sqlite ./
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

@ -101,7 +101,21 @@ def AppStoreUpdate():
raise CommandException(const.ERRORMESSAGE_SERVER_VERSION_NEEDUPGRADE, "You must upgrade websoft9 core", "You must upgrade websoft9 core")
elif core_support == "1":
raise CommandException(const.ERRORMESSAGE_SERVER_VERSION_NOTSUPPORT, "core not support,can not upgrade", "core not support,can not upgrade")
appstore_update()
local_path = '/usr/share/cockpit/appstore/appstore.json'
local_version = "0"
try:
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
local_version = json.loads(op)['Version']
except:
local_version = "0.0.0"
version_cmd = "curl " + const.ARTIFACT_URL + "/plugin/appstore/appstore.json"
latest = shell_execute.execute_command_output_all(version_cmd)['result']
version = json.loads(latest)['Version']
if local_version < version:
appstore_update()
else:
myLogger.info_logger("You click update appstore, but not need to update")
# 获取 update info
def get_update_list():