mirror of
https://github.com/mempool/mempool.git
synced 2025-03-13 11:36:07 +01:00
Adding console log messages to websocket error handling.
This commit is contained in:
parent
5d4ce44627
commit
a6809e99f1
1 changed files with 2 additions and 1 deletions
|
@ -114,6 +114,7 @@ export class WebsocketService {
|
|||
},
|
||||
(err: Error) => {
|
||||
console.log(err);
|
||||
console.log('WebSocket error, trying to reconnect in 10 seconds');
|
||||
this.goOffline();
|
||||
});
|
||||
}
|
||||
|
@ -140,7 +141,6 @@ export class WebsocketService {
|
|||
goOffline() {
|
||||
this.goneOffline = true;
|
||||
this.stateService.isOffline$.next(true);
|
||||
console.log('Error, retrying in 10 sec');
|
||||
window.setTimeout(() => this.startSubscription(), 10000);
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,7 @@ export class WebsocketService {
|
|||
this.websocketSubject.next({action: 'ping'});
|
||||
this.onlineCheckTimeoutTwo = window.setTimeout(() => {
|
||||
if (!this.goneOffline) {
|
||||
console.log('WebSocket response timeout, force closing, trying to reconnect in 10 seconds');
|
||||
this.websocketSubject.complete();
|
||||
this.goOffline();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue