Skip to content

Commit

Permalink
make Cache.__load private, it should only be called in Cache.cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-1F committed Jun 23, 2024
1 parent 1bd9fa2 commit 5add1e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mcdreforged_plugin_manager/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
4 changes: 2 additions & 2 deletions mcdreforged_plugin_manager/storage/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 5add1e4

Please sign in to comment.