增加重试机制&小修改

This commit is contained in:
Hex
2023-05-06 23:36:37 +08:00
parent 1d54295c6f
commit 1bfe62a621
2 changed files with 15 additions and 2 deletions

15
bot.js
View File

@@ -76,7 +76,20 @@ const requestApi = async (url, inputOptions = {}) => {
const gotOptions = {
method: options.method.toUpperCase(),
headers: options.headers
headers: options.headers,
retry: {
limit: 2,
methods: [
'GET',
'POST'
],
statusCodes: [
],
errorCodes: [
'ECONNRESET',
'EAI_AGAIN'
]
}
};
if (options.method === 'get') {