perf: 筛选统计去掉 JSON 兜底,并补上 orders 覆盖索引
去掉 work_orders 堆访问后,JOIN 会把 orders 整表扫进 Hash Right Join。 领取页在快照新鲜时不再打上游;快手出网统一 10 秒超时。倒计时改为自适应间隔。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,6 +23,23 @@ test('保留清理必须覆盖 work_order_events,否则这张只增不减的
|
||||
)
|
||||
})
|
||||
|
||||
test('保留任务要回填漏写的付款派生列,并在有命中时打日志', async () => {
|
||||
const src = await readJobSource()
|
||||
assert.ok(
|
||||
src.includes('source_order_amount_fen IS NULL'),
|
||||
'只处理派生列为空的行,避免把合法 0 或已落列的金额改掉',
|
||||
)
|
||||
assert.ok(
|
||||
src.includes("material_json->'source'->>'orderAmountFen'"),
|
||||
'回填口径必须与 083 / resolveSourceOrderAmountFen 相同',
|
||||
)
|
||||
assert.ok(src.includes("~ '^-?[0-9]{1,15}$'"), '超长数字不能 ::bigint,否则整次保留任务失败')
|
||||
assert.ok(
|
||||
src.includes('source_order_amount_fen 出现漏写'),
|
||||
'有命中必须打日志,否则金额静默回退 orders.total_amount',
|
||||
)
|
||||
})
|
||||
|
||||
test('保留清理默认窗口:敏感报文/事件 180 天,审计 365 天,工单事件 180 天', async () => {
|
||||
const defaults = await readFile(new URL('../../config/defaults.ts', import.meta.url), 'utf8')
|
||||
for (const line of [
|
||||
|
||||
Reference in New Issue
Block a user