add tacking
This commit is contained in:
@@ -63,6 +63,7 @@ func mustDecode[T any](fileName, path string) (T, error) {
|
||||
type ConfigService struct {
|
||||
repository *repository.ConfigRepository
|
||||
serverRepository *repository.ServerRepository
|
||||
serverService *ServerService
|
||||
}
|
||||
|
||||
func NewConfigService(repository *repository.ConfigRepository, serverRepository *repository.ServerRepository) *ConfigService {
|
||||
@@ -72,6 +73,10 @@ func NewConfigService(repository *repository.ConfigRepository, serverRepository
|
||||
}
|
||||
}
|
||||
|
||||
func (as ConfigService) SetServerService(serverService *ServerService) {
|
||||
as.serverService = serverService
|
||||
}
|
||||
|
||||
// UpdateConfig
|
||||
// Updates physical config file and caches it in database.
|
||||
//
|
||||
@@ -131,6 +136,8 @@ func (as ConfigService) UpdateConfig(ctx *fiber.Ctx, body *map[string]interface{
|
||||
return nil, err
|
||||
}
|
||||
|
||||
as.serverService.StartAccServerRuntime(server)
|
||||
|
||||
// Log change
|
||||
return as.repository.UpdateConfig(context, &model.Config{
|
||||
ServerID: uint(serverID),
|
||||
|
||||
Reference in New Issue
Block a user