fix: auto-fix code quality [skip ci]
This commit is contained in:
1 parent
771783d991
commit
401155b501
12 files changed
+200
-235
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user