Skip to content

Commit c9a7643

Browse files
authored
Merge pull request #94 from harness/FFM-3676
FFM-3676: changing pullInterval unit to sec + updating defaults to 60s
2 parents 43a082e + e41f832 commit c9a7643

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func (c *CfClient) authenticate(ctx context.Context) error {
304304
}
305305

306306
func (c *CfClient) makeTicker(interval uint) *time.Ticker {
307-
return time.NewTicker(time.Minute * time.Duration(interval))
307+
return time.NewTicker(time.Second * time.Duration(interval))
308308
}
309309

310310
func (c *CfClient) pullCronJob(ctx context.Context) {

client/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
type config struct {
1717
url string
1818
eventsURL string
19-
pullInterval uint // in minutes
19+
pullInterval uint // in seconds
2020
Cache cache.Cache
2121
Store storage.Storage
2222
Logger logger.Logger
@@ -41,7 +41,7 @@ func newDefaultConfig() *config {
4141
return &config{
4242
url: "https://config.ff.harness.io/api/1.0",
4343
eventsURL: "https://events.ff.harness.io/api/1.0",
44-
pullInterval: 1,
44+
pullInterval: 60,
4545
Cache: defaultCache,
4646
Store: defaultStore,
4747
Logger: defaultLogger,

docs/further_reading.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can provide options by passing them in when the client is created e.g.
1111
client, err := harness.NewCfClient(myApiKey,
1212
harness.WithURL("https://config.ff.harness.io/api/1.0"),
1313
harness.WithEventsURL("https://events.ff.harness.io/api/1.0"),
14-
harness.WithPullInterval(1),
14+
harness.WithPullInterval(60),
1515
harness.WithStreamEnabled(false))
1616

1717
```
@@ -20,7 +20,7 @@ client, err := harness.NewCfClient(myApiKey,
2020
|-----------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
2121
| 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 |
2222
| 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 |
23-
| pollInterval | harness.WithPullInterval(1)) | when running in stream mode, the interval in minutes that we poll for changes. | 1 |
23+
| pollInterval | harness.WithPullInterval(60)) | when running in stream mode, the interval in seconds that we poll for changes. | 1 |
2424
| enableStream | harness.WithStreamEnabled(false), | Enable streaming mode. | true |
2525
| enableAnalytics | *Not Supported* | Enable analytics. Metrics data is posted every 60s | *Not Supported* |
2626

0 commit comments

Comments
 (0)