MCPcopy
hub / github.com/redis/go-redis / waitForIndexing

Function waitForIndexing

search_resp_test.go:359–372  ·  view source on GitHub ↗
(t *testing.T, client *redis.Client, index string, expectedDocs int)

Source from the content-addressed store, hash-verified

357}
358
359func waitForIndexing(t *testing.T, client *redis.Client, index string, expectedDocs int) {
360 t.Helper()
361 ctx := context.Background()
362 for i := 0; i < 100; i++ {
363 info, err := client.FTInfo(ctx, index).Result()
364 if err != nil {
365 t.Fatalf("FTInfo failed: %v", err)
366 }
367 if info.NumDocs >= expectedDocs {
368 return
369 }
370 }
371 t.Fatalf("Timeout waiting for indexing")
372}

Calls 2

ResultMethod · 0.65
FTInfoMethod · 0.65

Tested by

no test coverage detected