* Increase network timeouts (close #248) * Fix: on post error only update the ext link card if it's in use
This commit is contained in:
parent
06e09facfe
commit
ea4ec26683
2 changed files with 13 additions and 7 deletions
|
@ -1,7 +1,8 @@
|
|||
import AtpAgent from '@atproto/api'
|
||||
import RNFS from 'react-native-fs'
|
||||
|
||||
const TIMEOUT = 10e3 // 10s
|
||||
const GET_TIMEOUT = 15e3 // 15s
|
||||
const POST_TIMEOUT = 60e3 // 60s
|
||||
|
||||
export function doPolyfill() {
|
||||
AtpAgent.configure({fetch: fetchHandler})
|
||||
|
@ -43,7 +44,10 @@ async function fetchHandler(
|
|||
}
|
||||
|
||||
const controller = new AbortController()
|
||||
const to = setTimeout(() => controller.abort(), TIMEOUT)
|
||||
const to = setTimeout(
|
||||
() => controller.abort(),
|
||||
reqMethod === 'post' ? POST_TIMEOUT : GET_TIMEOUT,
|
||||
)
|
||||
|
||||
const res = await fetch(reqUri, {
|
||||
method: reqMethod,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue