fix(kv): Prevent infinite loop condition when listing tasks by org.

In the event that findTaskByIDWithAuth cannot find the task ID contained
in the bucket, the outer loop will never terminate.

This ensures that we are calling Next() along-side any calls to continue
while using a Cursor.
pull/16249/head
Brett Buddin 2019-12-17 16:38:20 -05:00
parent 213cdf58a9
commit 6b544919a3
No known key found for this signature in database
GPG Key ID: C51265E441C4C5AC
1 changed files with 1 additions and 0 deletions

View File

@ -399,6 +399,7 @@ func (s *Service) findTasksByOrg(ctx context.Context, tx Tx, filter influxdb.Tas
if err != nil {
if err == influxdb.ErrTaskNotFound {
// we might have some crufty index's
k, v = c.Next()
continue
}
return nil, 0, err