统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
+20 -23
View File
@@ -1,46 +1,43 @@
import type { Server } from "node:http";
import type { Server } from 'node:http'
import { stopKuaishouIndustrySendCallbackRetryWorker } from "../services/platforms/kuaishou-industry/send-code-service.js";
import { stopScheduledJobs } from "../services/scheduler/scheduler-service.js";
import { logError, logInfo } from "../utils/logger.js";
import type { StartupState } from "./state.js";
import { stopKuaishouIndustrySendCallbackRetryWorker } from '../services/platforms/kuaishou-industry/send-code-service.js'
import { stopScheduledJobs } from '../services/scheduler/scheduler-service.js'
import { logError, logInfo } from '../utils/logger.js'
import type { StartupState } from './state.js'
export function createShutdownController(
server: Server,
startupState: StartupState
) {
let shutdownStarted = false;
export function createShutdownController(server: Server, startupState: StartupState) {
let shutdownStarted = false
async function shutdown(signal: string) {
if (shutdownStarted) {
return;
return
}
shutdownStarted = true;
startupState.phase = "shutting_down";
logInfo("[shutdown]", `received ${signal}, closing HTTP server`);
shutdownStarted = true
startupState.phase = 'shutting_down'
logInfo('[shutdown]', `received ${signal}, closing HTTP server`)
stopScheduledJobs();
stopKuaishouIndustrySendCallbackRetryWorker();
stopScheduledJobs()
stopKuaishouIndustrySendCallbackRetryWorker()
if (!server.listening) {
return;
return
}
await new Promise<void>((resolve) => {
server.close((error) => {
if (error) {
logError("[shutdown]", "failed to close HTTP server", error);
process.exitCode = 1;
logError('[shutdown]', 'failed to close HTTP server', error)
process.exitCode = 1
}
resolve();
});
});
resolve()
})
})
}
return {
isShutdownStarted: () => shutdownStarted,
shutdown,
};
}
}