优化结构

This commit is contained in:
Yvan
2026-08-20 20:46:18 +08:00
parent 01b5c2f78a
commit 23bc29ce0f
67 changed files with 1594 additions and 465 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ import (
"strconv"
"kra/internal/conf"
"kra/internal/integration/storage"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
@@ -375,7 +376,7 @@ func (d *Data) reloadConfig(ctx context.Context) error {
return fmt.Errorf("reload email configuration: %w", err)
}
next.Admin.Email = emailConfig
candidateStorage, err := buildFileStorage(next.Admin)
candidateStorage, err := storage.New(next.Admin)
if err != nil {
return fmt.Errorf("reload storage: %w", err)
}
@@ -410,7 +411,7 @@ func (d *Data) reloadConfig(ctx context.Context) error {
}
d.runtime.Replace(next.Data, next.Admin)
if d.storage != nil {
d.storage.replace(candidateStorage)
d.storage.Replace(candidateStorage)
}
closeCandidate = false
return nil