Skip to content

Commit

Permalink
allow for subscriptions to be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Apr 6, 2016
1 parent 635250c commit 57936fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- [#360](https://github.com/influxdata/kapacitor/pull/360): Forking tasks by measurement in order to improve performance
- [#386](https://github.com/influxdata/kapacitor/issues/386): Adds official Go HTTP client package.
- [#399](https://github.com/influxdata/kapacitor/issues/399): Allow disabling of subscriptions.

### Bugfixes

Expand Down
1 change: 1 addition & 0 deletions services/influxdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Config struct {
InsecureSkipVerify bool `toml:"insecure-skip-verify"`

Timeout toml.Duration `toml:"timeout"`
DisableSubscriptions bool `toml:"disable-subscriptions"`
Subscriptions map[string][]string `toml:"subscriptions"`
ExcludedSubscriptions map[string][]string `toml:"excluded-subscriptions"`
UDPBuffer int `toml:"udp-buffer"`
Expand Down
7 changes: 6 additions & 1 deletion services/influxdb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func NewService(configs []Config, defaultInfluxDB int, hostname string, l *log.L
startupTimeout: time.Duration(c.StartUpTimeout),
clusterID: clusterID,
subName: subName,
disableSubs: c.DisableSubscriptions,
}
if defaultInfluxDB == i {
defaultInfluxDBName = c.Name
Expand Down Expand Up @@ -148,6 +149,7 @@ type influxdb struct {
udpBuffer int
udpReadBuffer int
startupTimeout time.Duration
disableSubs bool

clusterID string
subName string
Expand Down Expand Up @@ -177,7 +179,10 @@ type subInfo struct {
}

func (s *influxdb) Open() error {
return s.linkSubscriptions()
if !s.disableSubs {
return s.linkSubscriptions()
}
return nil
}

func (s *influxdb) Close() error {
Expand Down

0 comments on commit 57936fa

Please sign in to comment.