Skip to content

Commit

Permalink
add sleep in for loop (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lkan authored Oct 13, 2024
1 parent 4d050c9 commit 7e5d3db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/sentry/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
package sentry

import (
"fmt"
"time"

"github.com/vmware-tanzu/secrets-manager/sdk/core/env"
log "github.com/vmware-tanzu/secrets-manager/sdk/core/log/std"
"github.com/vmware-tanzu/secrets-manager/sdk/lib/backoff"
Expand All @@ -25,6 +28,8 @@ import (
func Watch() {
interval := env.PollIntervalForSidecar()

fmt.Println("in watch: interval", interval)

cid, _ := crypto.RandomString(8)
if cid == "" {
panic("Unable to create a secure correlation id.")
Expand All @@ -43,5 +48,8 @@ func Watch() {
Delay: interval,
Exponential: false,
})

fmt.Println("will sleep for interval:", interval)
time.Sleep(interval)
}
}

0 comments on commit 7e5d3db

Please sign in to comment.