Skip to content

Commit

Permalink
Merge pull request #8878 from influxdata/amh-8794
Browse files Browse the repository at this point in the history
Do not report an error when dropping a CQ on a non-existent DB/RP
  • Loading branch information
jsternberg authored Feb 8, 2018
2 parents 262b699 + d21ebfe commit 4a22f7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions services/meta/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,9 @@ func TestMetaClient_ContinuousQueries(t *testing.T) {
t.Fatal(err)
}

// Dropping a nonexistent CQ should return an error.
if err := c.DropContinuousQuery("db0", "not-a-cq"); err == nil {
t.Fatal("expected an error, got nil")
// Dropping a nonexistent CQ should not return an error.
if err := c.DropContinuousQuery("db0", "not-a-cq"); err != nil {
t.Fatal(err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions services/meta/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func (data *Data) CreateContinuousQuery(database, name, query string) error {
func (data *Data) DropContinuousQuery(database, name string) error {
di := data.Database(database)
if di == nil {
return influxdb.ErrDatabaseNotFound(database)
return nil
}

for i := range di.ContinuousQueries {
Expand All @@ -450,7 +450,7 @@ func (data *Data) DropContinuousQuery(database, name string) error {
return nil
}
}
return ErrContinuousQueryNotFound
return nil
}

// validateURL returns an error if the URL does not have a port or uses a scheme other than UDP or HTTP.
Expand Down

0 comments on commit 4a22f7b

Please sign in to comment.