@metrichor/epi2me-web
Advanced tools
Comparing version 4.0.4466780 to 4.0.4467680
@@ -42,3 +42,3 @@ "use strict"; | ||
// poll the sources to see if any have changed, emits all the sources if any have | ||
this.updates$ = rxjs_1.timer(0, TELEMETRY_INTERVAL).pipe(operators_1.withLatestFrom(this.sources$), operators_1.switchMap(async ([, sources]) => { | ||
this.updates$ = rxjs_1.combineLatest([rxjs_1.interval(TELEMETRY_INTERVAL), this.sources$]).pipe(operators_1.switchMap(async ([, sources]) => { | ||
return Promise.all(sources.map(async (source) => { | ||
@@ -138,3 +138,3 @@ const response = await fetch_1.fetch(source.headUrl, { method: 'head' }); | ||
subscriber.next(sources); | ||
const expiresIn = sources.reduce((acc, source) => Math.min(acc, source.expiresIn), Infinity); | ||
const expiresIn = sources.reduce((acc, source) => Math.min(acc, source.expiresIn), Infinity) * 1000; | ||
const deltaTime = Date.now() - startTime; | ||
@@ -141,0 +141,0 @@ await sleep(expiresIn - deltaTime - EXPIRY_GRACE_PERIOD); |
import { fetch } from './network/fetch'; | ||
import { BehaviorSubject, timer } from 'rxjs'; | ||
import { BehaviorSubject, combineLatest, interval, timer } from 'rxjs'; | ||
import { delayWhen, distinctUntilChanged, filter, map, multicast, refCount, retryWhen, switchMap, withLatestFrom, } from 'rxjs/operators'; | ||
@@ -39,3 +39,3 @@ import { Observable } from 'rxjs'; | ||
// poll the sources to see if any have changed, emits all the sources if any have | ||
this.updates$ = timer(0, TELEMETRY_INTERVAL).pipe(withLatestFrom(this.sources$), switchMap(async ([, sources]) => { | ||
this.updates$ = combineLatest([interval(TELEMETRY_INTERVAL), this.sources$]).pipe(switchMap(async ([, sources]) => { | ||
return Promise.all(sources.map(async (source) => { | ||
@@ -135,3 +135,3 @@ const response = await fetch(source.headUrl, { method: 'head' }); | ||
subscriber.next(sources); | ||
const expiresIn = sources.reduce((acc, source) => Math.min(acc, source.expiresIn), Infinity); | ||
const expiresIn = sources.reduce((acc, source) => Math.min(acc, source.expiresIn), Infinity) * 1000; | ||
const deltaTime = Date.now() - startTime; | ||
@@ -138,0 +138,0 @@ await sleep(expiresIn - deltaTime - EXPIRY_GRACE_PERIOD); |
@@ -12,3 +12,3 @@ { | ||
"private": false, | ||
"version": "4.0.4466780", | ||
"version": "4.0.4467680", | ||
"main": "cjs/index-web.js", | ||
@@ -15,0 +15,0 @@ "module": "esm/index-web.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2412074