添加timeout超时

This commit is contained in:
lxk0301
2021-01-13 17:18:51 +08:00
parent 44aa2c98c6
commit 890b5e63a8
3 changed files with 7 additions and 3 deletions

View File

@ -1300,7 +1300,7 @@ async function showMsg() {
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/jxfactory/read/${randomCount}/`}, (err, resp, data) => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/jxfactory/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)

View File

@ -73,7 +73,11 @@ if ($.isNode()) {
}
continue
}
await jdFamily()
// await jdFamily()
while (true) {
await $.wait(31000)
await jdFamily()
}
}
}
})()

View File

@ -439,7 +439,7 @@ async function showMsg() {
}
function readShareCode() {
return new Promise(async resolve => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/pet/read/${randomCount}/`}, (err, resp, data) => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/pet/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)