mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 12:28:54 +00:00
fix: address infinite hang when infisical run watch fails
This commit is contained in:
+14
-13
@@ -419,22 +419,23 @@ func executeCommandWithWatchMode(commandFlag string, args []string, watchModeInt
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
<-recheckSecretsChannel
|
<-recheckSecretsChannel
|
||||||
watchMutex.Lock()
|
func() {
|
||||||
|
watchMutex.Lock()
|
||||||
|
defer watchMutex.Unlock()
|
||||||
|
|
||||||
newEnvironmentVariables, err := fetchAndFormatSecretsForShell(request, projectConfigDir, secretOverriding, token)
|
newEnvironmentVariables, err := fetchAndFormatSecretsForShell(request, projectConfigDir, secretOverriding, token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("[HOT RELOAD] Failed to fetch secrets")
|
log.Error().Err(err).Msg("[HOT RELOAD] Failed to fetch secrets")
|
||||||
continue
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if newEnvironmentVariables.ETag != currentETag {
|
if newEnvironmentVariables.ETag != currentETag {
|
||||||
runCommandWithWatcher(newEnvironmentVariables)
|
runCommandWithWatcher(newEnvironmentVariables)
|
||||||
} else {
|
} else {
|
||||||
log.Debug().Msg("[HOT RELOAD] No changes detected in secrets, not reloading process")
|
log.Debug().Msg("[HOT RELOAD] No changes detected in secrets, not reloading process")
|
||||||
}
|
}
|
||||||
|
|
||||||
watchMutex.Unlock()
|
|
||||||
|
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user