From 5add1e4c9ed660bc6e43e00ebdc97d42e8c00aa1 Mon Sep 17 00:00:00 2001 From: Ivan1F Date: Sun, 23 Jun 2024 05:36:03 -0300 Subject: [PATCH] make Cache.__load private, it should only be called in Cache.cache --- mcdreforged_plugin_manager/entry.py | 2 +- mcdreforged_plugin_manager/storage/cache.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mcdreforged_plugin_manager/entry.py b/mcdreforged_plugin_manager/entry.py index 375df74..f9d428b 100644 --- a/mcdreforged_plugin_manager/entry.py +++ b/mcdreforged_plugin_manager/entry.py @@ -83,7 +83,7 @@ def on_load(server: PluginServerInterface, old): if hasattr(old, 'cache_clock'): cache_clock.last_update_time = old.cache_clock.last_update_time cache_clock.start() - cache.load() + cache.cache() register_commands(server) server.register_help_message(constants.PREFIX, tr('help_summary')) diff --git a/mcdreforged_plugin_manager/storage/cache.py b/mcdreforged_plugin_manager/storage/cache.py index af1445e..c566f10 100644 --- a/mcdreforged_plugin_manager/storage/cache.py +++ b/mcdreforged_plugin_manager/storage/cache.py @@ -60,14 +60,14 @@ def cache(self): except Exception as e: psi.logger.warning(tr('cache.exception', e)) else: - self.load() + self.__load() psi.logger.info(tr('cache.cached', self.plugin_amount - before)) if config.check_update: from mcdreforged_plugin_manager.util import upgrade_helper upgrade_helper.show_check_update_result(psi.logger.info) - def load(self): + def __load(self): self.plugin_amount = 0 self.plugins.clear()