mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: unify message channel shutdown convergence
This commit is contained in:
@@ -77,13 +77,9 @@ class SlackModule(_MessageChannelModuleBase[Slack]):
|
||||
"""
|
||||
return 3
|
||||
|
||||
def stop(self) -> None:
|
||||
"""停止模块"""
|
||||
for client in self.get_instances().values():
|
||||
try:
|
||||
client.stop()
|
||||
except Exception as err:
|
||||
logger.error(f"停止Slack模块实例失败:{err}")
|
||||
def stop(self) -> bool:
|
||||
"""停止全部 Slack 实例,并返回资源是否全部收敛。"""
|
||||
return self._stop_service_instances()
|
||||
|
||||
def init_setting(self) -> Tuple[str, Union[str, bool]]:
|
||||
pass
|
||||
|
||||
@@ -117,13 +117,16 @@ class Slack:
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
def stop(self):
|
||||
def stop(self) -> bool:
|
||||
"""关闭 Socket Mode 服务,并返回资源是否成功释放。"""
|
||||
if self._service:
|
||||
try:
|
||||
self._service.close()
|
||||
logger.info("Slack消息接收服务已停止")
|
||||
except Exception as err:
|
||||
logger.error("Slack消息接收服务停止失败: %s" % str(err))
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_state(self) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user