mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-11 00:22:05 +00:00
fix: reduce unnecessary file writes at startup
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user