Skip to content

Commit

Permalink
Revert local examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSinn committed Jun 21, 2024
1 parent ade8610 commit def4715
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions example/local/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ func main() {

user := devcycle.User{UserId: "test"}
dvcOptions := devcycle.Options{
EventFlushIntervalMS: 1 * time.Minute,
ConfigPollingIntervalMS: 1 * time.Second,
EnableBetaRealtimeUpdates: os.Getenv("DEVCYCLE_REALTIME_UPDATES") == "true",
EventFlushIntervalMS: 0,
ConfigPollingIntervalMS: 10 * time.Second,
RequestTimeout: 10 * time.Second,
}

client, err := devcycle.NewClient(sdkKey, &dvcOptions)
time.Sleep(10 * time.Second)
if err != nil {
log.Fatalf("Error initializing client: %v", err)
}
//fmt.Println(client.GetRawConfig())
fmt.Println(client.GetRawConfig())
log.Printf("client initialized")

features, _ := client.AllFeatures(user)
Expand Down Expand Up @@ -82,16 +82,8 @@ func main() {
log.Fatalf("Error flushing events: %v", err)
}

prevAllVariable, _ := client.AllVariables(user)
for {
currentVariables, _ := client.AllVariables(user)
if len(currentVariables) != len(prevAllVariable) {
fmt.Println("HEY - NEW VARIABLES! - HERE THEY ARE!")
fmt.Println(currentVariables)
prevAllVariable = currentVariables
}
time.Sleep(2 * time.Second)
}
time.Sleep(2 * time.Second)

client.Close()

}

0 comments on commit def4715

Please sign in to comment.