fix(servers): 同名重建服务器时旧行从头开始,不再继承上一任的主人、别名、allowlist 和回收警告

This commit is contained in:
Lemon-miaow committed 2026-09-27 02:30:54 +08:00
1 parent 7aa5034c1a
commit d807fd5887
4 files changed
+130 -10

No files matched your search

+6
View File
@@ -878,6 +878,12 @@ func (f *fakeRepo) SeedServer(_ context.Context, name, subdomain string, _, _, _
if bound, ok := f.aliases[subdomain]; ok && bound != name {
return ErrConflict
}
// Like the SQL: an earlier server of this name gives up its other aliases.
for sub, bound := range f.aliases {
if bound == name && sub != subdomain {
delete(f.aliases, sub)
}
}
f.seeded[name] = true
f.aliases[subdomain] = name
return nil