后端架构更新
This commit is contained in:
@@ -559,7 +559,7 @@ function statusClass(status?: string) {
|
||||
}
|
||||
|
||||
function canDownload(item: PatrolDeleteHistoryItem) {
|
||||
return Boolean(item.resultId && (item.outputFilename || item.downloadUrl));
|
||||
return Boolean(item.resultId && (item.fileReady || item.downloadUrl));
|
||||
}
|
||||
|
||||
function saveMatchedItems() {
|
||||
@@ -717,14 +717,20 @@ async function refreshActiveTaskProgress(taskIds?: number[]) {
|
||||
function startHistoryPolling() {
|
||||
stopHistoryPolling();
|
||||
if (!hasQueueWork.value) return;
|
||||
historyPollTimer = window.setInterval(() => {
|
||||
void refreshActiveTaskProgress();
|
||||
}, getTaskPollIntervalMs() * 2);
|
||||
const run = async () => {
|
||||
historyPollTimer = null;
|
||||
if (!hasQueueWork.value) return;
|
||||
await refreshActiveTaskProgress();
|
||||
if (hasQueueWork.value) {
|
||||
historyPollTimer = window.setTimeout(run, getTaskPollIntervalMs() * 2);
|
||||
}
|
||||
};
|
||||
historyPollTimer = window.setTimeout(run, getTaskPollIntervalMs() * 2);
|
||||
}
|
||||
|
||||
function stopHistoryPolling() {
|
||||
if (historyPollTimer) {
|
||||
window.clearInterval(historyPollTimer);
|
||||
window.clearTimeout(historyPollTimer);
|
||||
historyPollTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user