Skip to content

Commit

Permalink
fix(cluster): increase timeout
Browse files Browse the repository at this point in the history
Raspberrys can be a bit unreliable on WiFi sometimes and drop out of the
cluster with a short timeout. An increased timeout gives them more room.
This may result in the cluster being without leader for a bit longer,
but that isn't too dramatic.
  • Loading branch information
mKeRix committed Jan 27, 2020
1 parent 6e8027b commit bcb0d5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cluster/cluster.service.spec.ts
Expand Up @@ -69,7 +69,8 @@ describe('ClusterService', () => {
it('should determine the local IP', () => {
expect(Democracy).toHaveBeenCalledWith({
source: '192.168.1.108:6425',
peers: []
peers: [],
timeout: 30000
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/cluster/cluster.service.ts
Expand Up @@ -44,7 +44,8 @@ export class ClusterService extends Democracy
).address;
super({
source: `${ip}:${config.port}`,
peers: Array.from(config.peerAddresses)
peers: Array.from(config.peerAddresses),
timeout: 30000
});

this.networkInterfaces = networkInterfaces;
Expand Down

0 comments on commit bcb0d5a

Please sign in to comment.