Skip to content

Commit bd32763

Browse files
fix(sharded): fix count in fetchSockets() method (#523)
If `fetchSockets()` is called shortly after the adapter was initialized, the server count may still return 0, causing this to fail with "timeout reached: only 0 responses received out of -1".
1 parent ef5f0da commit bd32763

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cluster-adapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export abstract class ClusterAdapter extends Adapter {
436436
]);
437437
const expectedResponseCount = serverCount - 1;
438438

439-
if (opts.flags?.local || expectedResponseCount === 0) {
439+
if (opts.flags?.local || expectedResponseCount <= 0) {
440440
return localSockets;
441441
}
442442

0 commit comments

Comments
 (0)