优化代码逻辑,修改超时轮询时间,内部单包安装模式不插入数据库

This commit is contained in:
wangsong 2021-11-29 15:23:01 +08:00
parent b71abbb124
commit 8e74641453
4 changed files with 9 additions and 7 deletions

View File

@ -14,8 +14,7 @@ DBusGMainLoop(set_as_default=True)
from .Core.MyCache import MyCache
from .UpdateManagerDbus import UpdateManagerDbusController,UPDATER_DBUS_INTERFACE,UPDATER_DBUS_PATH,UPDATER_DBUS_SERVICE
from .Core.UpdateList import UpdateList
from .backend import (InstallBackend,
get_backend)
from .backend import InstallBackend,get_backend
from .Core.Database import Sqlite3Server
from .Core.loop import mainloop

View File

@ -3,7 +3,7 @@ import os
import dbus
import dbus.service
import logging
import time
from gettext import gettext as _
from .backend import InstallBackend
from .Core.loop import mainloop

View File

@ -17,8 +17,9 @@ import dbus,time
from gi.repository import GLib
# 超时检测 秒单位
UPDATER_IDLE_CHECK_INTERVAL = 30
UPDATER_IDLE_TIMEOUT = 20 * 60
UPDATER_IDLE_CHECK_INTERVAL = 10
#超过15分钟的安装时间则退出
UPDATER_IDLE_TIMEOUT = 15 * 60
import dbus
from SystemUpdater.Core.utils import (LockedPreventShutdown)

View File

@ -496,9 +496,11 @@ class InstallBackend():
self.window_main.sqlite3_server.insert_info(upgrade_mode,[],self.now_upgrade.upgrade_groups,self.upgrade_data.adjust_pkgs,True,'', '')
else:
self.window_main.sqlite3_server.insert_info(upgrade_mode,[],self.now_upgrade.upgrade_groups,self.upgrade_data.adjust_pkgs,False,error_string, group_error_log + error_desc)
#其他的部分升级直接存入数据库 不需要进行计算
else:
#其他的部分升级直接存入数据库 不需要进行计算 单包安装模式不插入 数据库
elif upgrade_mode != self.MODE_UPGRADE_SINGLE:
self.window_main.sqlite3_server.insert_info(upgrade_mode,self.now_upgrade.single_pkgs,self.now_upgrade.upgrade_groups,self.upgrade_data.adjust_pkgs,success,error_string, error_desc)
else:
logging.info("To Upgrade or Install in MODE_UPGRADE_SINGLE mode and not insert sqlite")
except Exception as e:
logging.error(str(e))