MCPcopy Create free account
hub / github.com/Semporia/Scripts / checkTask

Function checkTask

jd_mcxhd.js:208–233  ·  view source on GitHub ↗
(itemToken)

Source from the content-addressed store, hash-verified

206 })
207}
208function checkTask(itemToken) {
209 let body = {"itemToken":itemToken}
210 return new Promise(resolve => {
211 $.get(taskUrl('checkTaskStatus', body), async (err, resp, data) => {
212 try {
213 if (err) {
214 console.log(`${JSON.stringify(err)}`)
215 console.log(`${$.name} API请求失败,请检查网路重试`)
216 } else {
217 if (safeGet(data)) {
218 data = JSON.parse(data);
219 if (data.retCode === '200') {
220 console.log(`任务完成成功`)
221 } else {
222 console.log(`任务完成失败,${data.retMessage}`)
223 }
224 }
225 }
226 } catch (e) {
227 $.logErr(e, resp)
228 } finally {
229 resolve();
230 }
231 })
232 })
233}
234function taskList() {
235 return new Promise(resolve => {
236 $.get(taskUrl('taskList'), async (err, resp, data) => {

Callers 1

doTaskFunction · 0.85

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected