fix: auto-fix code quality [skip ci]

This commit is contained in:
asepharyana committed 2026-09-23 22:11:00 +07:00
1 parent 771783d991
commit 401155b501
12 files changed
+200 -235

No files matched your search

+7 -2
View File
@@ -18,10 +18,15 @@ export interface GracefulShutdownOptions {
stopMetricsServer?: StopMetricsServer;
}
export function createGracefulShutdown(options: GracefulShutdownOptions) {
export type GracefulShutdown = (signal: string) => Promise<void>;
/** Create a shutdown handler that can only be triggered once. */
export function createGracefulShutdown(
options: GracefulShutdownOptions,
): GracefulShutdown {
let isShuttingDown = false;
return async function gracefulShutdown(signal: string) {
return async function gracefulShutdown(signal: string): Promise<void> {
if (isShuttingDown) {
options.logger.warn(`Already shutting down, ignoring ${signal}`);
return;