mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-11 17:45:32 +00:00
fix: handle anilist 500 errors
This commit is contained in:
parent
1bb771992f
commit
f5cd3d745e
1 changed files with 3 additions and 1 deletions
|
|
@ -60,6 +60,8 @@ let rl = null
|
|||
limiter.on('failed', async (error, jobInfo) => {
|
||||
printError(error)
|
||||
|
||||
if (error.status === 500) return 1
|
||||
|
||||
if (!error.statusText) {
|
||||
if (!rl) rl = sleep(61 * 1000).then(() => { rl = null })
|
||||
return 61 * 1000
|
||||
|
|
@ -77,7 +79,7 @@ const handleRequest = limiter.wrap(async opts => {
|
|||
} catch (e) {
|
||||
if (!res || res.status !== 404) throw e
|
||||
}
|
||||
if (!res.ok && res.status === 429) {
|
||||
if (!res.ok && (res.status === 429 || res.status === 500)) {
|
||||
throw res
|
||||
}
|
||||
let json = null
|
||||
|
|
|
|||
Loading…
Reference in a new issue