This commit is contained in:
jxxghp
2023-08-04 16:14:52 +08:00
parent 99dcf96c7c
commit 541a8d725d
7 changed files with 9 additions and 26 deletions

View File

@ -1,3 +1,4 @@
import gc
import pickle
import traceback
from abc import ABCMeta
@ -55,6 +56,10 @@ class ChainBase(metaclass=ABCMeta):
pickle.dump(cache, f)
except Exception as err:
logger.error(f"保存缓存 {filename} 出错:{err}")
finally:
# 主动资源回收
del cache
gc.collect()
def run_module(self, method: str, *args, **kwargs) -> Any:
"""