统一前后端代码格式化配置
This commit is contained in:
@@ -33,11 +33,7 @@ import {
|
||||
} from './account-selector.js'
|
||||
import { resolvePersistedCloudtentaclesContextBySourceKeys } from './cloudtentacles-context.js'
|
||||
import { wrapCloudtentaclesOperationError } from './cloudtentacles-errors.js'
|
||||
import {
|
||||
getTaskClaimExpiresAt,
|
||||
normalizeActor,
|
||||
parseTaskContext,
|
||||
} from './task-context.js'
|
||||
import { getTaskClaimExpiresAt, normalizeActor, parseTaskContext } from './task-context.js'
|
||||
import { resolveKuaishouCloudDeliveryPlan } from './delivery-plan.js'
|
||||
import { ensureTaskClaimLink } from './ensure-claim-link.js'
|
||||
import {
|
||||
@@ -332,11 +328,14 @@ export async function prepareKuaishouCloudFulfillmentTask(task: TaskRow, options
|
||||
}
|
||||
|
||||
function isRetryableCloudtentaclesSourceError(error: unknown) {
|
||||
const current = error && typeof error === 'object' ? error as JsonObject : {}
|
||||
const current = error && typeof error === 'object' ? (error as JsonObject) : {}
|
||||
const code = String(current.errorCode || current.code || '').trim()
|
||||
return (
|
||||
code === 'cloudtentacles_vn_quota_cooldown' ||
|
||||
(code === 'cloudtentacles_vn_appoint_failed' && String(current.message || '').trim().includes('最多同时占用')) ||
|
||||
(code === 'cloudtentacles_vn_appoint_failed' &&
|
||||
String(current.message || '')
|
||||
.trim()
|
||||
.includes('最多同时占用')) ||
|
||||
code === 'cloudtentacles_vn_list_failed' ||
|
||||
code === 'cloudtentacles_sku_list_failed' ||
|
||||
code === 'cloudtentacles_knapsack_failed' ||
|
||||
@@ -484,8 +483,9 @@ export async function refreshKuaishouCloudTaskBindUrl(task: TaskRow, options: Js
|
||||
binding: {
|
||||
...flow.binding,
|
||||
prepareStatus: 'ready',
|
||||
resolvedSourceKey:
|
||||
String(cloudContext.resolvedSourceKey || flow.binding.resolvedSourceKey || '').trim(),
|
||||
resolvedSourceKey: String(
|
||||
cloudContext.resolvedSourceKey || flow.binding.resolvedSourceKey || '',
|
||||
).trim(),
|
||||
bindUrl,
|
||||
bindPreparedAt: now,
|
||||
bindExpiresAt: resolveKuaishouCloudBindUrlExpiresAt(now),
|
||||
@@ -667,8 +667,9 @@ export async function refreshKuaishouCloudTaskBindUrl(task: TaskRow, options: Js
|
||||
binding: {
|
||||
...flow.binding,
|
||||
prepareStatus: 'ready',
|
||||
resolvedSourceKey:
|
||||
String(cloudContext.resolvedSourceKey || flow.binding.resolvedSourceKey || '').trim(),
|
||||
resolvedSourceKey: String(
|
||||
cloudContext.resolvedSourceKey || flow.binding.resolvedSourceKey || '',
|
||||
).trim(),
|
||||
vnKey: preparedBinding.vnKey,
|
||||
vnId: preparedBinding.vnId,
|
||||
vnPhone: preparedBinding.vnPhone,
|
||||
@@ -739,7 +740,6 @@ export async function refreshKuaishouCloudTaskBindUrl(task: TaskRow, options: Js
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function markKuaishouCloudBindUrlRefreshFailed(
|
||||
task: TaskRow,
|
||||
{
|
||||
@@ -855,7 +855,7 @@ async function clearKuaishouCloudStaleBinding(
|
||||
error: unknown
|
||||
claimUrl: string
|
||||
token: string
|
||||
}
|
||||
},
|
||||
) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error || '绑定已失效')
|
||||
const oldVnId = flow.binding.vnId
|
||||
@@ -912,7 +912,7 @@ async function clearKuaishouCloudStaleBinding(
|
||||
errorMessage,
|
||||
actor,
|
||||
},
|
||||
now
|
||||
now,
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user