perf(代码审查落地): 后端 A1-A8 与前端 C1-C8 加固,retention 清理补索引(V141)
A 组(backend-java): - A1 载荷引用计数不再无条件回落全表 COUNT - A2 结果行读取由 LIMIT 1 改整页 - A3 ziniao 索引缓存过期判断下推 SQL - A4 循环子任务认领改 CAS,失败一律抛 - A5 建单事务里不碰外部 IO - A6 连接池补网络层超时(connectTimeout/socketTimeout,env 可覆盖) - A7 日志留现场 + 异步落盘 - A8 其余:货源图片预取、结果工作簿装配等 - V141:三条 retention DELETE 的可用索引,其中 biz_price_track_loop_run 用 STORED 生成列承载 COALESCE 时间线(该表实测 881 行/17MB,COPY 秒级) C 组(frontend-vue):URL 取值走 safe-url、行号取值走 row-id、 交付视频任务状态抽成 delivery-video-task-state.ts,各补用例。
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, triggerRef, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
|
||||
@@ -269,7 +269,8 @@ const pendingFileIds = ref<number[]>([])
|
||||
const activeFileId = ref<number | null>(null)
|
||||
const dispatchOptions = ref<PublishDispatchOptions | null>(null)
|
||||
const queuedBatches = ref<PublishQueueBatch[]>([])
|
||||
const taskSnapshots = ref<Record<number, PublishTaskDetailVo>>({})
|
||||
/** 任务快照(审查 C3):整份可达数百 KB,shallowRef 只跟踪整份替换,写入后统一 triggerRef */
|
||||
const taskSnapshots = shallowRef<Record<number, PublishTaskDetailVo>>({})
|
||||
const historyItems = ref<PublishTaskDetailVo[]>([])
|
||||
const missingTaskIds = ref<number[]>([])
|
||||
const deletingTaskIds = ref<number[]>([])
|
||||
@@ -333,6 +334,7 @@ function mergeDetail(previous: PublishTaskDetailVo | undefined, incoming: Publis
|
||||
function applyTaskSnapshot(taskId: number, detail: PublishTaskDetailVo) {
|
||||
const merged = mergeDetail(taskSnapshots.value[taskId], detail)
|
||||
taskSnapshots.value = { ...taskSnapshots.value, [taskId]: merged }
|
||||
triggerRef(taskSnapshots)
|
||||
missingTaskIds.value = missingTaskIds.value.filter((id) => id !== taskId)
|
||||
if (currentTaskId.value === taskId) {
|
||||
currentFiles.value = mergeFiles(currentFiles.value, merged.files || [])
|
||||
@@ -707,6 +709,7 @@ function updateCurrentFile(fileId: number, patch: Partial<PublishFileItem>) {
|
||||
files: update(taskSnapshots.value[taskId].files || []),
|
||||
},
|
||||
}
|
||||
triggerRef(taskSnapshots)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,6 +1077,7 @@ function removeTaskLocally(taskId: number) {
|
||||
const snapshots = { ...taskSnapshots.value }
|
||||
delete snapshots[taskId]
|
||||
taskSnapshots.value = snapshots
|
||||
triggerRef(taskSnapshots)
|
||||
missingTaskIds.value = Array.from(new Set([...missingTaskIds.value, taskId]))
|
||||
queuedBatches.value = queuedBatches.value.filter((batch) => batch.taskId !== taskId)
|
||||
if (currentTaskId.value === taskId) {
|
||||
|
||||
Reference in New Issue
Block a user