mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
fix: ensure log and cache flags are processed during reload
During reload operations, log and cache flags were not being processed, which prevented runtime internal logs from working correctly. To fix this, processLogAndCacheFlags was refactored to accept explicit viper and config parameters instead of relying on global state, enabling it to be called during reload with the new configuration. This ensures that log and cache settings are properly applied when the service reloads its configuration.
This commit is contained in:
committed by
Cuong Manh Le
parent
091c7edb19
commit
80e652b8d9
+6
-1
@@ -213,7 +213,8 @@ func (p *prog) runWait() {
|
||||
continue
|
||||
}
|
||||
if cdUID != "" {
|
||||
if rc, err := processCDFlags(newCfg); err != nil {
|
||||
rc, err := processCDFlags(newCfg)
|
||||
if err != nil {
|
||||
logger.Err(err).Msg("could not fetch ControlD config")
|
||||
waitOldRunDone()
|
||||
continue
|
||||
@@ -225,6 +226,10 @@ func (p *prog) runWait() {
|
||||
}
|
||||
}
|
||||
|
||||
// Though the log configuration could not be changed during reloading, we still need to
|
||||
// process the current flags here, so runtime internal logs can be used correctly.
|
||||
processLogAndCacheFlags(v, newCfg)
|
||||
|
||||
waitOldRunDone()
|
||||
|
||||
p.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user