Skip to content

Commit

Permalink
chore(mwcp): remove sleep wait onStop()
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Oct 18, 2024
1 parent 3542a20 commit 2e90f27
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/midway-component-kmore/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -76,9 +75,7 @@ export class AutoConfiguration implements ILifeCycle {
@TraceInit({ namespace: ConfigKey.namespace })
async onStop(container: IMidwayContainer): Promise<void> {
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
Expand All @@ -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`)
}

}
Expand Down

0 comments on commit 2e90f27

Please sign in to comment.