Skip to content

Commit 49eb15f

Browse files
JounQinserhalp
andauthored
chore: increase timeout for connection requests to 30 seconds (npmx-dev#2684)
Co-authored-by: Philippe Serhal <philippe.serhal@gmail.com>
1 parent 3cb1e1c commit 49eb15f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/composables/useConnector.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface StateResponse {
5555

5656
const STORAGE_KEY = 'npmx-connector'
5757
const DEFAULT_PORT = 31415
58+
const CONNECT_TIMEOUT_MS = 30000
5859

5960
export const useConnector = createSharedComposable(function useConnector() {
6061
const { settings } = useSettings()
@@ -115,7 +116,7 @@ export const useConnector = createSharedComposable(function useConnector() {
115116
const response = await $fetch<ConnectResponse>(`http://127.0.0.1:${port}/connect`, {
116117
method: 'POST',
117118
body: { token },
118-
timeout: 5000,
119+
timeout: CONNECT_TIMEOUT_MS,
119120
})
120121

121122
if (response.success && response.data) {
@@ -180,7 +181,7 @@ export const useConnector = createSharedComposable(function useConnector() {
180181
headers: {
181182
Authorization: `Bearer ${config.value.token}`,
182183
},
183-
timeout: 5000,
184+
timeout: CONNECT_TIMEOUT_MS,
184185
})
185186

186187
if (response.success && response.data) {

0 commit comments

Comments
 (0)