mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 04:26:43 +00:00
Changes
This commit is contained in:
@@ -59,7 +59,7 @@ var runCmd = &cobra.Command{
|
|||||||
|
|
||||||
// If the --watch flag has been set, the --watch-interval flag should also be set
|
// If the --watch flag has been set, the --watch-interval flag should also be set
|
||||||
if watchFlagSet && watchIntervalFlagSet {
|
if watchFlagSet && watchIntervalFlagSet {
|
||||||
// Ensure that the --watch-interval flag is set to a positive integer, and is at least 10 seconds
|
// Ensure that the --watch-interval flag is set to a positive integer, and is at least 5 seconds
|
||||||
|
|
||||||
watchInterval, err := cmd.Flags().GetInt("watch-interval")
|
watchInterval, err := cmd.Flags().GetInt("watch-interval")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -273,7 +273,7 @@ func executeSpecifiedCommand(commandFlag string, args []string, watchMode bool,
|
|||||||
|
|
||||||
initialEnvironment, err := createInjectableEnvironment(request, projectConfigDir, secretOverriding, expandSecrets, token)
|
initialEnvironment, err := createInjectableEnvironment(request, projectConfigDir, secretOverriding, expandSecrets, token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.HandleError(err, "[HOT RELOAD] Failed to fetch secrets")
|
util.HandleError(err, "Failed to fetch secrets")
|
||||||
}
|
}
|
||||||
startProcess(initialEnvironment)
|
startProcess(initialEnvironment)
|
||||||
recheckSecretsChannel := make(chan bool, 1)
|
recheckSecretsChannel := make(chan bool, 1)
|
||||||
@@ -282,7 +282,7 @@ func executeSpecifiedCommand(commandFlag string, args []string, watchMode bool,
|
|||||||
if watchMode {
|
if watchMode {
|
||||||
log.Info().Msg(color.HiMagentaString("[HOT RELOAD] Watching for secret changes..."))
|
log.Info().Msg(color.HiMagentaString("[HOT RELOAD] Watching for secret changes..."))
|
||||||
|
|
||||||
// a simple goroutine that triggers the recheckSecretsChan every 5 seconds
|
// a simple goroutine that triggers the recheckSecretsChan every watch interval (defaults to 10 seconds)
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(time.Duration(watchModeInterval) * time.Second)
|
time.Sleep(time.Duration(watchModeInterval) * time.Second)
|
||||||
@@ -406,7 +406,6 @@ func createInjectableEnvironment(request models.GetAllSecretsParameters, project
|
|||||||
environmentVariables[k] = v.Value
|
environmentVariables[k] = v.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and sort the env slice using slices.SortFunc
|
|
||||||
env := make([]string, 0, len(environmentVariables))
|
env := make([]string, 0, len(environmentVariables))
|
||||||
for key, value := range environmentVariables {
|
for key, value := range environmentVariables {
|
||||||
env = append(env, key+"="+value)
|
env = append(env, key+"="+value)
|
||||||
|
|||||||
Reference in New Issue
Block a user