From d574f84079c2469b71e6c09c4b804e8bf6156153 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 20 Aug 2022 14:37:31 +0300 Subject: [PATCH] Fix saving plugin configs --- maubot/instance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maubot/instance.py b/maubot/instance.py index 4d797e4..895c700 100644 --- a/maubot/instance.py +++ b/maubot/instance.py @@ -276,7 +276,11 @@ class PluginInstance(DBInstance): def save_config(self, data: RecursiveDict[CommentedMap]) -> None: buf = io.StringIO() yaml.dump(data, buf) - self.config_str = buf.getvalue() + val = buf.getvalue() + if val != self.config_str: + self.config_str = val + self.log.debug("Creating background task to save updated config") + asyncio.create_task(self.update()) async def start_database( self, upgrade_table: UpgradeTable | None = None, actually_start: bool = True