Skip to content
Snippets Groups Projects
Commit 773be076 authored by Simon Döring's avatar Simon Döring
Browse files

Add timeout to janus api requests

parent 521088ec
Branches
No related tags found
No related merge requests found
...@@ -17,7 +17,8 @@ interface RoomConfig { ...@@ -17,7 +17,8 @@ interface RoomConfig {
} }
export const api = axios.create({ export const api = axios.create({
baseURL: config.janusURL baseURL: config.janusURL,
timeout: 2500
}); });
export const postRequest = <T extends { janus: JanusVerb }>( export const postRequest = <T extends { janus: JanusVerb }>(
...@@ -34,7 +35,9 @@ export const sessionLongPoll = ( ...@@ -34,7 +35,9 @@ export const sessionLongPoll = (
maxExents = 10 maxExents = 10
) => { ) => {
return api.get(`/${sessionId}?rid=${Date.now()}&maxev=${maxExents}`, { return api.get(`/${sessionId}?rid=${Date.now()}&maxev=${maxExents}`, {
cancelToken cancelToken,
// Answer should come in 30000ms
timeout: 35000
}); });
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment