Skip to content

Commit 83cd8e6

Browse files
committed
fix: bind "this" context in process hook
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
1 parent 7d55944 commit 83cd8e6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

apps/server-nestjs/src/cpin-module/application-initialization/application-initialization-service/application-initialization.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ export class ApplicationInitializationService {
111111
}
112112

113113
handleExit() {
114-
process.on('exit', this.logExitCode)
115-
process.on('SIGINT', this.exitGracefully)
116-
process.on('SIGTERM', this.exitGracefully)
117-
process.on('uncaughtException', this.exitGracefully)
118-
process.on('unhandledRejection', this.logUnhandledRejection)
114+
process.on('exit', this.logExitCode.bind(this))
115+
process.on('SIGINT', this.exitGracefully.bind(this))
116+
process.on('SIGTERM', this.exitGracefully.bind(this))
117+
process.on('uncaughtException', this.exitGracefully.bind(this))
118+
process.on('unhandledRejection', this.logUnhandledRejection.bind(this))
119119
}
120120
}

0 commit comments

Comments
 (0)