彻底重构-3
This commit is contained in:
@@ -2,10 +2,10 @@ import { query, withTransaction } from '../db/client.js'
|
||||
|
||||
const TASK_FIELDS = `
|
||||
ft.*,
|
||||
ct.id AS claim_token_id,
|
||||
ct.token AS claim_token,
|
||||
ct.status AS claim_token_status,
|
||||
ct.expired_at AS claim_token_expired_at,
|
||||
ct.id AS primary_claim_token_id,
|
||||
ct.token AS primary_claim_token,
|
||||
ct.status AS primary_claim_token_status,
|
||||
ct.expired_at AS primary_claim_expires_at,
|
||||
ctx.browser_session_id,
|
||||
ctx.login_type,
|
||||
ctx.nickname,
|
||||
@@ -16,10 +16,10 @@ const TASK_FIELDS = `
|
||||
ctx.screenshot_path,
|
||||
ctx.artifacts_json,
|
||||
ctx.state_json,
|
||||
inv.inventory_item_id AS reserved_cdk_id,
|
||||
inv.display_value AS cdk_code,
|
||||
inv.credential_type AS cdk_credential_type,
|
||||
inv.binding_status AS inventory_binding_status
|
||||
inv.inventory_item_id AS primary_inventory_item_id,
|
||||
inv.display_value AS primary_inventory_display_value,
|
||||
inv.credential_type AS primary_inventory_credential_type,
|
||||
inv.binding_status AS primary_inventory_binding_status
|
||||
`
|
||||
|
||||
const TASK_JOINS = `
|
||||
@@ -159,8 +159,11 @@ export async function updateTask(taskId, patch) {
|
||||
attempt_count = $11,
|
||||
last_error = $12,
|
||||
context_json = $13::jsonb,
|
||||
updated_at = $14
|
||||
WHERE id = $15
|
||||
claimed_at = $14,
|
||||
role_confirmed_at = $15,
|
||||
redeemed_at = $16,
|
||||
updated_at = $17
|
||||
WHERE id = $18
|
||||
`,
|
||||
[
|
||||
next.task_status,
|
||||
@@ -176,6 +179,9 @@ export async function updateTask(taskId, patch) {
|
||||
next.attempt_count || 0,
|
||||
next.last_error || '',
|
||||
next.context_json || '{}',
|
||||
next.claimed_at || null,
|
||||
next.role_confirmed_at || null,
|
||||
next.redeemed_at || null,
|
||||
next.updated_at,
|
||||
Number(taskId),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user