Skip to content

Commit 1b675b6

Browse files
committed
fix(api): try adding a 5s timeout on pipeline api fetch
1 parent c444ae0 commit 1b675b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/shared/data/apis/pipeline.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ interface Response {
4444
interface RequestInit {
4545
method?: string
4646
body?: {}
47+
signals?: AbortSignal
4748
}
4849
/**
4950
* PipelineAPI class to fetch data from the webserver.
@@ -81,7 +82,10 @@ export class PipelineAPI {
8182
webserviceUrlBuilder(ws),
8283
JSON.stringify(options)
8384
)
84-
return this.fetchFunc(webserviceUrlBuilder(ws), options)
85+
return this.fetchFunc(webserviceUrlBuilder(ws), {
86+
...options,
87+
signals: options?.signals ?? AbortSignal.timeout(5000),
88+
})
8589
.then((response: Response) => response.text())
8690
.then((text: string) => parser(text))
8791
}

0 commit comments

Comments
 (0)