modified: amazon/__pycache__/detail_spider.cpython-39.pyc
modified: amazon/__pycache__/price_match.cpython-39.pyc modified: amazon/detail_spider.py modified: amazon/price_match.py modified: blueprints/__pycache__/admin.cpython-39.pyc modified: blueprints/__pycache__/brand.cpython-39.pyc modified: blueprints/__pycache__/main.cpython-39.pyc modified: brand_spider/__pycache__/main.cpython-39.pyc modified: main.py modified: web_source/brand.html
This commit is contained in:
@@ -414,7 +414,7 @@
|
||||
<a class="nav-item" href="/new_web_source/product-risk.html">商品风险解决</a>
|
||||
<a class="nav-item" href="/new_web_source/shop-match.html">定时匹配</a>
|
||||
<a class="nav-item" href="/new_web_source/price-track.html">跟价</a>
|
||||
<a class="nav-item" href="/new_web_source/patrol-delete.html"巡店删除</a>
|
||||
<a class="nav-item" href="/new_web_source/patrol-delete.html">巡店删除</a>
|
||||
<a class="nav-item" href="/new_web_source/query-asin.html">查询ASIN</a>
|
||||
<span class="nav-item disabled">取款</span>
|
||||
<span class="nav-item disabled">店铺状态查询</span>
|
||||
@@ -785,24 +785,7 @@
|
||||
else if (status === 'cancelled') showToast('已取消');
|
||||
}
|
||||
|
||||
function verifyTerminalTaskStatus(taskId, expectedStatus) {
|
||||
return fetch('/api/brand/tasks/' + taskId, {
|
||||
credentials: 'include',
|
||||
headers: withUidHeaders({ 'X-Requested-With': 'XMLHttpRequest' })
|
||||
})
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(res) {
|
||||
if (!res.success || !res.task) return null;
|
||||
var actualStatus = (res.task.status || '').toLowerCase();
|
||||
if (actualStatus === 'success' || actualStatus === 'failed' || actualStatus === 'cancelled') {
|
||||
return actualStatus;
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.catch(function() { return null; });
|
||||
}
|
||||
|
||||
function pollRunTask(taskId) {
|
||||
function pollRunTask(taskId) {
|
||||
pollTaskId = taskId;
|
||||
var runProgressFill = document.getElementById('runProgressFill');
|
||||
var runProgressText = document.getElementById('runProgressText');
|
||||
@@ -865,18 +848,15 @@
|
||||
break;
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
if (terminalStatus) {
|
||||
var verifiedStatus = await verifyTerminalTaskStatus(taskId, terminalStatus);
|
||||
if (verifiedStatus) {
|
||||
try { runTaskEventAbortController.abort(); } catch (e2) {}
|
||||
runTaskEventAbortController = null;
|
||||
onRunTaskFinished(verifiedStatus);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (terminalStatus) {
|
||||
try { runTaskEventAbortController.abort(); } catch (e2) {}
|
||||
runTaskEventAbortController = null;
|
||||
onRunTaskFinished(terminalStatus);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (err) {}
|
||||
})();
|
||||
|
||||
@@ -938,7 +918,7 @@
|
||||
});
|
||||
}
|
||||
tick();
|
||||
pollTimer = setInterval(tick, 3000);
|
||||
pollTimer = setInterval(tick, 10000);
|
||||
}
|
||||
|
||||
document.getElementById('btnRun').onclick = function() {
|
||||
@@ -1148,11 +1128,7 @@
|
||||
});
|
||||
|
||||
loadTasks();
|
||||
setInterval(function() {
|
||||
if (cachedTasks.some(function(t) { return (t.status || '').toLowerCase() === 'running'; })) {
|
||||
loadTasks();
|
||||
}
|
||||
}, 3000);
|
||||
// setInterval(loadTasks, 10000);
|
||||
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('pywebviewready', function() {
|
||||
|
||||
Reference in New Issue
Block a user