mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Clear plugin webapp routes in default stop()
This commit is contained in:
parent
05acf08e5b
commit
ec6578294f
@ -1,2 +1,3 @@
|
|||||||
from .plugin_base import Plugin
|
from .plugin_base import Plugin
|
||||||
|
from .plugin_server import PluginWebApp
|
||||||
from .matrix import MaubotMatrixClient as Client, MaubotMessageEvent as MessageEvent
|
from .matrix import MaubotMatrixClient as Client, MaubotMessageEvent as MessageEvent
|
||||||
|
@ -62,6 +62,8 @@ class Plugin(ABC):
|
|||||||
async def stop(self) -> None:
|
async def stop(self) -> None:
|
||||||
for func, event_type in self._handlers_at_startup:
|
for func, event_type in self._handlers_at_startup:
|
||||||
self.client.remove_event_handler(event_type, func)
|
self.client.remove_event_handler(event_type, func)
|
||||||
|
if self.webapp:
|
||||||
|
self.webapp.clear()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_config_class(cls) -> Optional[Type['BaseProxyConfig']]:
|
def get_config_class(cls) -> Optional[Type['BaseProxyConfig']]:
|
||||||
|
Loading…
Reference in New Issue
Block a user