fix: reduce unnecessary file writes at startup

This commit is contained in:
2026-07-06 22:40:46 +08:00
parent 2789be852e
commit 2e610bc8ef
2 changed files with 21 additions and 4 deletions
+5 -1
View File
@@ -95,7 +95,8 @@ class DeployConfig(ConfigModel):
def read(self):
self.config = poor_yaml_read(DEPLOY_TEMPLATE)
self.config_template = copy.deepcopy(self.config)
self.config.update(poor_yaml_read(self.file))
origin = poor_yaml_read(self.file)
self.config.update(origin)
for key, value in self.config.items():
if hasattr(self, key):
@@ -103,6 +104,9 @@ class DeployConfig(ConfigModel):
self.config_redirect()
if self.config != origin:
self.write()
def write(self):
poor_yaml_write(self.config, self.file)