Skip to content

Commit

Permalink
trying all ports
Browse files Browse the repository at this point in the history
  • Loading branch information
asdine committed Aug 2, 2024
1 parent d31882b commit 13efae5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/debug-reindexing-endpoint/reindexing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,14 @@ func reindex(ctx context.Context, client *wvt.Client, className string) error {
for _, port := range ports {
resp, err = httpClient.Post(fmt.Sprintf("http://localhost:%d/debug/reindex/collection/%s/shards/%s", port, className, shardName), "application/json", nil)
if err != nil {
log.Printf("Failed to reindex shard %s on port %d: %v. Trying a different port...", shardName, port, err)
log.Printf("Shard %s not found on port %d. err: %v. Trying a different port...", shardName, err, port)
continue
}
if resp.StatusCode != http.StatusNotFound {
break
}

log.Printf("Shard %s not found on port %d. Trying a different port...", shardName, port)
}
if resp == nil {
return fmt.Errorf("failed to reindex shard %s on all ports", shardName)
Expand Down

0 comments on commit 13efae5

Please sign in to comment.