fix: redirect deploy config after Updator.delay()

This commit is contained in:
2026-07-05 23:27:02 +08:00
parent 99862137f1
commit d6e52d7720
2 changed files with 15 additions and 10 deletions
+13 -10
View File
@@ -77,19 +77,9 @@ class DeployConfig(ConfigModel):
self.config_template = {}
self.read()
self.set_repo()
self.write()
self.show_config()
def set_repo(self):
# Bypass webui.config.DeployConfig.__setattr__()
# Don't write these into deploy.yaml
if self.Repository == 'cn':
super().__setattr__('Repository', 'https://git.yoursfunny.top/YoursFunny/ArisuAutoSweeper.git')
if self.Repository == 'global':
super().__setattr__('Repository', 'https://github.com/TheFunny/ArisuAutoSweeper')
def show_config(self):
logger.hr("Show deploy config", 1)
for k, v in self.config.items():
@@ -110,9 +100,22 @@ class DeployConfig(ConfigModel):
if hasattr(self, key):
super().__setattr__(key, value)
self.config_redirect()
def write(self):
poor_yaml_write(self.config, self.file)
def config_redirect(self):
"""
Redirect deploy config, must be called after each `read()`
"""
# Bypass webui.config.DeployConfig.__setattr__()
# Don't write these into deploy.yaml
if self.Repository == 'cn':
super().__setattr__('Repository', 'https://git.yoursfunny.top/YoursFunny/ArisuAutoSweeper.git')
if self.Repository == 'global':
super().__setattr__('Repository', 'https://github.com/TheFunny/ArisuAutoSweeper')
def filepath(self, path):
"""
Args:
+2
View File
@@ -37,6 +37,8 @@ class DeployConfig(_DeployConfig):
if hasattr(self, key):
super().__setattr__(key, value)
self.config_redirect()
def write(self):
"""
Write `self.config` into deploy config.