mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix(modules): serialize configuration reload lifecycle (#6122)
This commit is contained in:
@@ -43,12 +43,6 @@ class TheMovieDbModule(_ModuleBase):
|
||||
self.category = CategoryHelper()
|
||||
self.scraper = TmdbScraper()
|
||||
|
||||
def on_config_changed(self):
|
||||
# 停止模块
|
||||
self.stop()
|
||||
# 初始化模块
|
||||
self.init_module()
|
||||
|
||||
@staticmethod
|
||||
def get_name() -> str:
|
||||
return "TheMovieDb"
|
||||
@@ -74,9 +68,13 @@ class TheMovieDbModule(_ModuleBase):
|
||||
"""
|
||||
return 1
|
||||
|
||||
def stop(self):
|
||||
self.cache.save()
|
||||
self.tmdb.close()
|
||||
def stop(self) -> None:
|
||||
"""停止模块"""
|
||||
# 缓存持久化失败不能阻断 HTTP 客户端关闭
|
||||
try:
|
||||
self.cache.save()
|
||||
finally:
|
||||
self.tmdb.close()
|
||||
|
||||
def test(self) -> Tuple[bool, str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user