Skip to content

Commit

Permalink
mer timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Anders Robbestad committed Dec 11, 2020
1 parent 7d3657c commit 6343251
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/src/tilstand/moduler/meg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { createAction, createSlice, PayloadAction } from "@reduxjs/toolkit";
import { RootStateOrAny } from "react-redux";
import { ActionsObservable, ofType, StateObservable } from "redux-observable";
import { concat, from, of } from "rxjs";
import { catchError, concatAll, map, mergeMap, retryWhen, withLatestFrom } from "rxjs/operators";
import {
catchError,
concatAll,
map,
mergeMap,
retryWhen,
timeout,
withLatestFrom,
} from "rxjs/operators";
import { provIgjenStrategi } from "../../utility/rxUtils";
import { AjaxCreationMethod, AjaxObservable } from "rxjs/internal-compatibility";
import { oppgaveHentingFeilet as oppgaveFeiletHandling } from "./oppgave";
Expand Down Expand Up @@ -108,6 +116,7 @@ export function hentMegEpos(
mergeMap(([action, state]) => {
return getJSON<GraphOgEnhet>(megUrl)
.pipe(
timeout(5000),
map((response: Graphdata) => {
return {
fornavn: response.givenName,
Expand All @@ -121,6 +130,7 @@ export function hentMegEpos(
.pipe(
map((graphData) => {
return getJSON<[EnhetData]>(`/api/ansatte/${graphData.id}/enheter`).pipe(
timeout(5000),
map((response: [EnhetData]) => {
return concat([
<Array<EnhetData>>response,
Expand Down

0 comments on commit 6343251

Please sign in to comment.