优化结构
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user