Skip to content

Commit

Permalink
Added patch to reset the check for update scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky4546 committed Apr 25, 2023
1 parent db72233 commit e739c65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/common/utils.py
Expand Up @@ -37,7 +37,7 @@

import lib.common.exceptions as exceptions

VERSION = '0.9.12.15'
VERSION = '0.9.12.16'
CABERNET_URL = 'https://github.com/cabernetwork/cabernet'
CABERNET_ID = 'cabernet'
CABERNET_REPO = 'manifest.json'
Expand Down
11 changes: 10 additions & 1 deletion lib/updater/patcher.py
Expand Up @@ -22,6 +22,7 @@

from lib.plugins.plugin_manager.plugin_manager import PluginManager
from lib.db.db_plugins import DBPlugins
from lib.db.db_scheduler import DBScheduler


REQUIRED_VERSION = '0.9.12'
Expand Down Expand Up @@ -49,7 +50,7 @@ def patch_upgrade(_config_obj, _new_version):
plugin_db = DBPlugins(_config_obj.data)
pm = PluginManager(None, _config_obj)

# get list of all installed plugins
# All plugins should be in the ext folder
plugin_list = plugin_db.get_plugins(True)
if plugin_list:
for plugin in plugin_list:
Expand All @@ -58,6 +59,14 @@ def patch_upgrade(_config_obj, _new_version):
results = pm.install_plugin(plugin['repoid'], plugin['id'])
results = 'Patch: Moving {} to plugins_ext ...'.format(plugin['id'])
LOGGER.warning('Patch: Moving {} to plugins_ext ...'.format(plugin['id']))

# Check for Updates schedule task needs to be inline with high priority
schedule_db = DBScheduler(_config_obj.data)
task = schedule_db.get_tasks('Applications', 'Check for Updates')
if task and task[0]['threadtype'] != 'inline':
schedule_db.del_task('Applications', 'Check for Updates')
LOGGER.warning('Resetting Check For Update task')

except Exception:
# Make sure that the patcher exits normally so the maintenance flag is removed
LOGGER.warning(traceback.format_exc())
Expand Down

0 comments on commit e739c65

Please sign in to comment.