From 2e90f27945b27e4fd29d14440438a5b690402f4c Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Fri, 18 Oct 2024 14:27:35 +0800 Subject: [PATCH] chore(mwcp): remove sleep wait onStop() --- packages/midway-component-kmore/src/configuration.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/midway-component-kmore/src/configuration.ts b/packages/midway-component-kmore/src/configuration.ts index ecc2ab1c..e4c73920 100644 --- a/packages/midway-component-kmore/src/configuration.ts +++ b/packages/midway-component-kmore/src/configuration.ts @@ -18,7 +18,6 @@ import { deleteRouter, registerMiddleware, } from '@mwcp/share' -import { sleep } from '@waiting/shared-core' import * as DefaultConfig from './config/config.default.js' import * as LocalConfig from './config/config.local.js' @@ -76,9 +75,7 @@ export class AutoConfiguration implements ILifeCycle { @TraceInit({ namespace: ConfigKey.namespace }) async onStop(container: IMidwayContainer): Promise { void container - const time = 2 - await sleep(time * 1000) - this.logger.info(`[${ConfigKey.componentName}] onStop()`) + this.logger.info(`[${ConfigKey.componentName}] stopping`) // const { timeoutWhenDestroy } = this.kmoreComponentConfig const out = 10000 @@ -89,7 +86,7 @@ export class AutoConfiguration implements ILifeCycle { .catch((ex: Error) => { console.error(ex.message) }) - this.logger.info(`[${ConfigKey.componentName}] onStop() done`) + this.logger.info(`[${ConfigKey.componentName}] stopped`) } }