feat: 重载后恢复诸个单例对象

This commit is contained in:
Rock Chin
2023-01-01 23:18:32 +08:00
parent 7e83ba3f77
commit 82e3ef6497
9 changed files with 79 additions and 100 deletions

View File

@@ -3,6 +3,7 @@ import logging
import pkg
import importlib
import pkgutil
import pkg.utils.context
def walk(module, prefix=''):
@@ -15,5 +16,7 @@ def walk(module, prefix=''):
def reload_all():
context = pkg.utils.context.context
walk(pkg)
importlib.reload(__import__('config'))
pkg.utils.context.context = context