Skip to content

Commit

Permalink
FFM-3676: changing pullInterval unit to sec + updaring defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
akiraqb committed Jul 25, 2022
1 parent 43a082e commit e41f832
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (c *CfClient) authenticate(ctx context.Context) error {
}

func (c *CfClient) makeTicker(interval uint) *time.Ticker {
return time.NewTicker(time.Minute * time.Duration(interval))
return time.NewTicker(time.Second * time.Duration(interval))
}

func (c *CfClient) pullCronJob(ctx context.Context) {
Expand Down
4 changes: 2 additions & 2 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type config struct {
url string
eventsURL string
pullInterval uint // in minutes
pullInterval uint // in seconds
Cache cache.Cache
Store storage.Storage
Logger logger.Logger
Expand All @@ -41,7 +41,7 @@ func newDefaultConfig() *config {
return &config{
url: "https://config.ff.harness.io/api/1.0",
eventsURL: "https://events.ff.harness.io/api/1.0",
pullInterval: 1,
pullInterval: 60,
Cache: defaultCache,
Store: defaultStore,
Logger: defaultLogger,
Expand Down
4 changes: 2 additions & 2 deletions docs/further_reading.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can provide options by passing them in when the client is created e.g.
client, err := harness.NewCfClient(myApiKey,
harness.WithURL("https://config.ff.harness.io/api/1.0"),
harness.WithEventsURL("https://events.ff.harness.io/api/1.0"),
harness.WithPullInterval(1),
harness.WithPullInterval(60),
harness.WithStreamEnabled(false))

```
Expand All @@ -20,7 +20,7 @@ client, err := harness.NewCfClient(myApiKey,
|-----------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| baseUrl | harness.WithURL("https://config.ff.harness.io/api/1.0") | the URL used to fetch feature flag evaluations. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://config.ff.harness.io/api/1.0 |
| eventsUrl | harness.WithEventsURL("https://events.ff.harness.io/api/1.0"), | the URL used to post metrics data to the feature flag service. You should change this when using the Feature Flag proxy to http://localhost:7000 | https://events.ff.harness.io/api/1.0 |
| pollInterval | harness.WithPullInterval(1)) | when running in stream mode, the interval in minutes that we poll for changes. | 1 |
| pollInterval | harness.WithPullInterval(60)) | when running in stream mode, the interval in seconds that we poll for changes. | 1 |
| enableStream | harness.WithStreamEnabled(false), | Enable streaming mode. | true |
| enableAnalytics | *Not Supported* | Enable analytics. Metrics data is posted every 60s | *Not Supported* |

Expand Down

0 comments on commit e41f832

Please sign in to comment.