Skip to content

Commit

Permalink
Don't append retention service if not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Jun 5, 2015
1 parent ad24a81 commit 00c262d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions cmd/influxd/run/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (s *Server) appendClusterService(c cluster.Config) {
}

func (s *Server) appendRetentionPolicyService(c retention.Config) {
if !c.Enabled {
return
}
srv := retention.NewService(c)
srv.MetaStore = s.MetaStore
srv.TSDBStore = s.TSDBStore
Expand Down
5 changes: 0 additions & 5 deletions services/retention/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type Service struct {
// NewService returns a configure retention policy enforcement service.
func NewService(c Config) *Service {
return &Service{
enabled: c.Enabled,
checkInterval: time.Duration(c.CheckInterval),
done: make(chan struct{}),
logger: log.New(os.Stderr, "[retention] ", log.LstdFlags),
Expand All @@ -43,10 +42,6 @@ func NewService(c Config) *Service {

// Open starts retention policy enforcement.
func (s *Service) Open() error {
if !s.enabled {
return nil
}

s.wg.Add(2)
go s.deleteShardGroups()
go s.deleteShards()
Expand Down

0 comments on commit 00c262d

Please sign in to comment.