- .repeatWhen
- .catch((err) => {
- this._status.connected = false;
- throw new Error("Syncthing local daemon not responding (url=" + this._status.baseURL + ")");
+ .retryWhen((attempts) => {
+ this._status.connectionRetry = 0;
+ return attempts.flatMap(error => {
+ this._status.connected = false;
+ if (++this._status.connectionRetry >= this.connectionMaxRetry) {
+ return Observable.throw("Syncthing local daemon not responding (url=" + this._status.baseURL + ")");
+ } else {
+ return Observable.timer(1000);
+ }
+ });