File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,14 @@ function getHostName(ip: string) {
4646// If this fails, it will return an empty array, so the rest of the code can still run and a clustermap still gets generated
4747async function getHostsInExamMode ( ) {
4848 try {
49+ const controller = new AbortController ( ) ;
50+ const timeout = setTimeout ( ( ) => controller . abort ( ) , 3000 ) ;
51+
4952 // The URL below is only accessible from allowed IP ranges. Ask Codam IT for access if developing locally and you get a 403 error
50- const request = await fetch ( "https://clusterdata.codam.nl/api/exam_mode_hosts" ) ;
53+ const request = await fetch ( "https://clusterdata.codam.nl/api/exam_mode_hosts" , {
54+ signal : controller . signal ,
55+ } ) ;
56+ clearTimeout ( timeout ) ;
5157 const response = await request . json ( ) ;
5258 if ( "error" in response ) {
5359 throw new Error ( response [ "error" ] ) ;
You can’t perform that action at this time.
0 commit comments