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:
@@ -135,7 +135,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref, shallowRef, triggerRef } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import AmazonToolPageShell from '@/pages/amazon/components/AmazonToolPageShell.vue';
|
||||
import FileUploadZone from '@/shared/components/FileUploadZone.vue'
|
||||
@@ -239,8 +239,11 @@ const dashboard = ref<CollectDataDashboardVo>({
|
||||
})
|
||||
const currentItems = ref<CollectDataHistoryItem[]>([])
|
||||
const historyItems = ref<CollectDataHistoryItem[]>([])
|
||||
/** 轮询过程中收到的任务最新快照,按 taskId 缓存,用于历史返回前的占位展示 */
|
||||
const taskSnapshots = ref<Record<number, CollectDataTaskDetailVo>>({})
|
||||
/**
|
||||
* 轮询过程中收到的任务最新快照,按 taskId 缓存,用于历史返回前的占位展示
|
||||
* (审查 C3:整份快照含行明细、体积大,改 shallowRef,写入一律整份替换并 triggerRef)
|
||||
*/
|
||||
const taskSnapshots = shallowRef<Record<number, CollectDataTaskDetailVo>>({})
|
||||
|
||||
const POLLING_STORAGE_KEY = 'brand:collect-data:polling-task-ids'
|
||||
|
||||
@@ -306,6 +309,7 @@ const progressLoop = useTaskProgressLoop<CollectDataTaskDetailVo>({
|
||||
// 只有轮询字段(或行明细)真的变了才展开快照对象:整份快照含行明细,无变化时重建纯属浪费
|
||||
if (!prev || merged.items !== prev.items || taskProgressSignatureOf(prev) !== taskProgressSignatureOf(merged)) {
|
||||
taskSnapshots.value = { ...taskSnapshots.value, [taskId]: merged }
|
||||
triggerRef(taskSnapshots)
|
||||
}
|
||||
patchCurrentItem(taskId, detail.items?.[0], detail.task?.status)
|
||||
},
|
||||
@@ -314,6 +318,7 @@ const progressLoop = useTaskProgressLoop<CollectDataTaskDetailVo>({
|
||||
const next = { ...taskSnapshots.value }
|
||||
delete next[taskId]
|
||||
taskSnapshots.value = next
|
||||
triggerRef(taskSnapshots)
|
||||
}
|
||||
await Promise.all([loadDashboard(), loadHistory()])
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user