测试多任务暂存
This commit is contained in:
6
app/.env
6
app/.env
@@ -6,10 +6,12 @@ mysql_user=aiimage
|
||||
proxy_url=https://api.jikip.com/ip-get?num=1&minute=1&format=json&area=all&protocol=1&mode=2&key=t24g6gi44ubufd8
|
||||
proxy_mode=2
|
||||
|
||||
zn_company=rongchuang123
|
||||
zn_username=%E8%87%AA%E5%8A%A8%E5%8C%96_Robot
|
||||
|
||||
client_name=ShuFuAI
|
||||
|
||||
|
||||
java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://8.136.19.173:18080
|
||||
java_api_base=http://8.136.19.173:18080
|
||||
|
||||
|
||||
|
||||
15
app/.env copy
Normal file
15
app/.env copy
Normal file
@@ -0,0 +1,15 @@
|
||||
base_url=http://8.136.19.173:15124
|
||||
workflow_id=7608812635877900322
|
||||
mysql_host=8.136.19.173
|
||||
mysql_user=aiimage
|
||||
|
||||
proxy_url=https://api.jikip.com/ip-get?num=1&minute=1&format=json&area=all&protocol=1&mode=2&key=t24g6gi44ubufd8
|
||||
proxy_mode=2
|
||||
|
||||
client_name=ShuFuAI
|
||||
|
||||
|
||||
java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://8.136.19.173:18080
|
||||
|
||||
|
||||
Binary file not shown.
BIN
app/amazon/__pycache__/del_brand.cpython-312.pyc
Normal file
BIN
app/amazon/__pycache__/del_brand.cpython-312.pyc
Normal file
Binary file not shown.
BIN
app/amazon/__pycache__/main.cpython-312.pyc
Normal file
BIN
app/amazon/__pycache__/main.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
{"version": "1.0.22"}
|
||||
{"version": "1.0.13"}
|
||||
@@ -417,7 +417,35 @@ function getDisplayError(item: DeleteBrandResultItem) {
|
||||
}
|
||||
|
||||
function shouldShowProgress(item: DeleteBrandResultItem) {
|
||||
const taskId = item.taskId
|
||||
if (!taskId) return false
|
||||
|
||||
const progress = taskDetails.value[taskId]?.line_progress
|
||||
const multiFileTask = isMultiFileTask(taskId)
|
||||
const qs = getQueueStatus(item)
|
||||
|
||||
// 已完成/终态后隐藏进度条。
|
||||
if (qs === '本文件解析完毕' || qs === '已被全局判定为终态') {
|
||||
return false
|
||||
}
|
||||
|
||||
if (multiFileTask) {
|
||||
const sessionItem = findSessionItem(taskId, item)
|
||||
// 多文件任务:未入队的文件不展示同一个 task 的公共进度,避免“两个文件同时在跑”的错觉。
|
||||
if (!sessionItem?._pushed) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (progress?.has_progress && progress?.info?.file_name) {
|
||||
return progress.info.file_name === item.sourceFilename
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if (progress?.has_progress || progress?.info) {
|
||||
return true
|
||||
}
|
||||
|
||||
return qs === '已入队' || qs === '处理中'
|
||||
}
|
||||
|
||||
@@ -550,14 +578,20 @@ function getQueueStatus(item: DeleteBrandResultItem) {
|
||||
return '已被全局判定为终态'
|
||||
}
|
||||
|
||||
if (status === 'RUNNING' && info?.has_progress && info?.info?.file_name === item.sourceFilename) {
|
||||
return '处理中'
|
||||
// 多文件:未推送的文件必须保持“未入队”,避免被同 task 的公共 RUNNING 状态误判成“处理中”。
|
||||
if (multiFileTask && !sessionItem?._pushed && !sessionItem?._completed) {
|
||||
return '未入队'
|
||||
}
|
||||
|
||||
// 先看前端会话态:一旦该文件已判定完成,优先展示完成,避免被 RUNNING 覆盖导致链式推进卡住。
|
||||
if (sessionItem?._completed) {
|
||||
return '本文件解析完毕'
|
||||
}
|
||||
|
||||
if (status === 'RUNNING' && info?.has_progress && info?.info?.file_name === item.sourceFilename) {
|
||||
return '处理中'
|
||||
}
|
||||
|
||||
if (multiFileTask && status === 'SUCCESS') {
|
||||
return '本文件解析完毕'
|
||||
}
|
||||
@@ -916,6 +950,11 @@ function formatPreview(rows: DeleteBrandPreviewRow[]) {
|
||||
return hiddenCount > 0 ? `${preview.join('、')} 等 ${rows.length} 条` : preview.join('、')
|
||||
}
|
||||
|
||||
function debugAutoAdvance(step: string, payload?: Record<string, unknown>) {
|
||||
if (!import.meta.env.DEV) return
|
||||
console.log(`[DeleteBrandAutoAdvance] ${step}`, payload || {})
|
||||
}
|
||||
|
||||
function isPythonQueueBusy() {
|
||||
for (const task of sessionTasks.value) {
|
||||
for (const item of task.items) {
|
||||
@@ -945,6 +984,11 @@ function findNextAutoRunnableItem() {
|
||||
|
||||
async function runItem(item: DeleteBrandResultItem, options?: { auto?: boolean }) {
|
||||
if (options?.auto && isPythonQueueBusy()) {
|
||||
debugAutoAdvance('runItem blocked by busy queue', {
|
||||
mode: 'auto',
|
||||
taskId: item.taskId,
|
||||
sourceFilename: item.sourceFilename,
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -992,8 +1036,17 @@ async function runItem(item: DeleteBrandResultItem, options?: { auto?: boolean }
|
||||
}
|
||||
|
||||
async function maybeAutoAdvance() {
|
||||
if (!chainStarted.value || autoAdvancing.value) return
|
||||
if (isPythonQueueBusy()) return
|
||||
if (!chainStarted.value || autoAdvancing.value) {
|
||||
debugAutoAdvance('skip: chain not started or auto advancing', {
|
||||
chainStarted: chainStarted.value,
|
||||
autoAdvancing: autoAdvancing.value,
|
||||
})
|
||||
return
|
||||
}
|
||||
if (isPythonQueueBusy()) {
|
||||
debugAutoAdvance('skip: queue busy')
|
||||
return
|
||||
}
|
||||
|
||||
const currentKey = activeItemKey.value
|
||||
if (currentKey) {
|
||||
@@ -1002,15 +1055,33 @@ async function maybeAutoAdvance() {
|
||||
const taskId = currentItem.taskId
|
||||
const multiFileTask = isMultiFileTask(taskId)
|
||||
if (multiFileTask) {
|
||||
updateCompletedItemsFromProgress(taskId)
|
||||
const changed = updateCompletedItemsFromProgress(taskId)
|
||||
debugAutoAdvance('sync completed from progress', {
|
||||
taskId,
|
||||
changed,
|
||||
status: getQueueStatus(currentItem),
|
||||
})
|
||||
}
|
||||
const status = getQueueStatus(currentItem)
|
||||
if (status === '已入队' || status === '处理中') {
|
||||
debugAutoAdvance('skip: current item still running', {
|
||||
currentKey,
|
||||
status,
|
||||
taskId,
|
||||
sourceFilename: currentItem.sourceFilename,
|
||||
})
|
||||
return
|
||||
}
|
||||
if (multiFileTask) {
|
||||
const sessionItem = findSessionItem(taskId, currentItem)
|
||||
if (sessionItem && !sessionItem._completed) {
|
||||
debugAutoAdvance('skip: multi-file current not completed yet', {
|
||||
currentKey,
|
||||
taskId,
|
||||
sourceFilename: currentItem.sourceFilename,
|
||||
pushed: sessionItem._pushed,
|
||||
completed: sessionItem._completed,
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -1019,6 +1090,9 @@ async function maybeAutoAdvance() {
|
||||
|
||||
const nextItem = findNextAutoRunnableItem()
|
||||
if (!nextItem) {
|
||||
debugAutoAdvance('stop chain: no next runnable item', {
|
||||
currentKey,
|
||||
})
|
||||
activeItemKey.value = ''
|
||||
chainStarted.value = false
|
||||
return
|
||||
@@ -1026,8 +1100,17 @@ async function maybeAutoAdvance() {
|
||||
|
||||
autoAdvancing.value = true
|
||||
try {
|
||||
debugAutoAdvance('try start next item', {
|
||||
taskId: nextItem.taskId,
|
||||
sourceFilename: nextItem.sourceFilename,
|
||||
nextKey: getItemKey(nextItem),
|
||||
})
|
||||
const started = await runItem(nextItem, { auto: true })
|
||||
if (!started) {
|
||||
debugAutoAdvance('stop chain: runItem returned false', {
|
||||
taskId: nextItem.taskId,
|
||||
sourceFilename: nextItem.sourceFilename,
|
||||
})
|
||||
chainStarted.value = false
|
||||
}
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user