统一前后端代码格式化配置
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { logError, logInfo, logWarn } from '../../utils/logger.js'
|
||||
import { createHttpError } from '../../utils/http.js'
|
||||
import type { JsonObject } from '../../types/json.js'
|
||||
import {
|
||||
getScheduledJobById,
|
||||
getScheduledJobsConfig,
|
||||
} from './config-service.js'
|
||||
import { getScheduledJobById, getScheduledJobsConfig } from './config-service.js'
|
||||
import { runCloudtentaclesHealthJob } from './cloudtentacles-health-job.js'
|
||||
import { runDepositUnfreezeJob } from './deposit-unfreeze-job.js'
|
||||
import { runWorkOrderTimeoutJob } from './work-order-timeout-job.js'
|
||||
@@ -52,7 +49,9 @@ export function getScheduledJobRuntimeStates() {
|
||||
|
||||
export async function runScheduledJobNow(jobId: unknown) {
|
||||
const config = getScheduledJobsConfig()
|
||||
const job = config.jobs.find((item) => String(item.id || '').trim() === String(jobId || '').trim())
|
||||
const job = config.jobs.find(
|
||||
(item) => String(item.id || '').trim() === String(jobId || '').trim(),
|
||||
)
|
||||
|
||||
if (!job) {
|
||||
throw createHttpError('定时任务不存在', {
|
||||
@@ -131,8 +130,7 @@ async function runJob(job: JsonObject, { manual = false }: { manual?: boolean }
|
||||
|
||||
try {
|
||||
const result = await dispatchJob(job)
|
||||
const summary =
|
||||
result && typeof result === 'object' ? (result as JsonObject) : {}
|
||||
const summary = result && typeof result === 'object' ? (result as JsonObject) : {}
|
||||
updateJobState(jobId, {
|
||||
running: false,
|
||||
lastFinishedAt: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user