mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 04:22:50 +00:00
feat: connection timeout
This commit is contained in:
committed by
Rainer Killinger
parent
945ae039eb
commit
cbc59795b7
@@ -12,7 +12,18 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {fromEvent, merge, ObservableInput, of, race, RetryConfig, share, Subject, takeUntil} from 'rxjs';
|
||||
import {
|
||||
delay,
|
||||
fromEvent,
|
||||
merge,
|
||||
ObservableInput,
|
||||
of,
|
||||
race,
|
||||
RetryConfig,
|
||||
share,
|
||||
Subject,
|
||||
takeUntil,
|
||||
} from 'rxjs';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {filter, map, startWith, take, tap} from 'rxjs/operators';
|
||||
import {NGXLogger} from 'ngx-logger';
|
||||
@@ -43,6 +54,7 @@ export class InternetConnectionService {
|
||||
* registering itself.
|
||||
*/
|
||||
readonly retryConfig: RetryConfig = {
|
||||
count: 5,
|
||||
delay: this.doRetry.bind(this),
|
||||
};
|
||||
|
||||
@@ -52,6 +64,7 @@ export class InternetConnectionService {
|
||||
tap(it => console.log(it)),
|
||||
filter(it => !it),
|
||||
take(1),
|
||||
delay(Math.min(retryCount ** 4 + 100, 10_000)),
|
||||
),
|
||||
this.manualRetry$,
|
||||
).pipe(
|
||||
|
||||
Reference in New Issue
Block a user