mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
added retry catch to vuex current history panel syncer for pages with slow current history loads
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
// Sync Galaxy store to legacy galaxy current history
|
||||
|
||||
import { fromEvent } from "rxjs";
|
||||
import { map, filter, switchMap, pluck, distinctUntilChanged } from "rxjs/operators";
|
||||
import { map, filter, switchMap, pluck, distinctUntilChanged, retryWhen, take, delay } from "rxjs/operators";
|
||||
|
||||
export function syncCurrentHistoryToGalaxy(galaxy$, store, cfg = {}) {
|
||||
const { retryPeriod = 500, retries = 20 } = cfg;
|
||||
|
||||
export function syncCurrentHistoryToGalaxy(galaxy$, store) {
|
||||
// prettier-ignore
|
||||
const historyId$ = galaxy$.pipe(
|
||||
pluck("currHistoryPanel"),
|
||||
@@ -14,6 +16,10 @@ export function syncCurrentHistoryToGalaxy(galaxy$, store) {
|
||||
map(() => panel.model.id)
|
||||
);
|
||||
}),
|
||||
retryWhen(err$ => err$.pipe(
|
||||
delay(retryPeriod),
|
||||
take(retries)
|
||||
)),
|
||||
filter(Boolean),
|
||||
distinctUntilChanged()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user