Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
🐛 Stopping the cycle mid-load should not make the cycle be unhealthy
Browse files Browse the repository at this point in the history
  • Loading branch information
peteclark-ft committed Jun 1, 2017
1 parent 96e70f4 commit 02907d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion native/in_memory_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func LoadIntoMemory(ctx context.Context, uuidCollection UUIDCollection, collecti
for {
if ctx.Err() != nil {
log.WithError(ctx.Err()).Warn("Interrupting cursor load due to cycle stop.")
return it, ctx.Err()
return it, nil
}

finished, uuid, err := uuidCollection.Next()
Expand Down
3 changes: 1 addition & 2 deletions native/in_memory_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ func TestLoadIntoMemoryWithContextInterrupt(t *testing.T) {
go func() {
defer wg.Done()
_, err := LoadIntoMemory(ctx, uuidCollection, "collection", 0, noopBlacklist)
assert.Error(t, err)
assert.Equal(t, "context canceled", err.Error())
assert.NoError(t, err)

completed = true
}()
Expand Down

0 comments on commit 02907d2

Please sign in to comment.