Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "5.35.0",
"version": "5.36.0",
"description": "One foundation for multiple applications.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
12 changes: 10 additions & 2 deletions src/helpers/LoadHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,21 @@ export class LoadHelper {
await this.providers.athenna.concurrently(Provider => {
debug('running shutdown() method of provider %s.', Provider.name)

if (Config.is('rc.shutdownLogs', true)) {
const log = () => {
Log.channelOrVanilla('application').success(
`Provider ({yellow} ${Provider.name}) successfully shutdown`
)
}

return new Provider().shutdown() as Promise<void>
const shutdown = new Provider().shutdown() as Promise<void>

if (!shutdown?.then) {
log()

return
}

return shutdown.then(() => log())
})
}

Expand Down
10 changes: 4 additions & 6 deletions src/ignite/Ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type {
} from '#src/types'

import { Ioc } from '@athenna/ioc'
import { debug } from '#src/debug'
import { Cron } from '#src/applications/Cron'
import { Http } from '#src/applications/Http'
import type { ServerImpl } from '@athenna/http'
Expand All @@ -35,7 +36,6 @@ import { Repl as ReplApp } from '#src/applications/Repl'
import { parse as semverParse, satisfies as semverSatisfies } from 'semver'
import { Is, Path, File, Module, Options, Macroable } from '@athenna/common'
import { NotSatisfiedNodeVersion } from '#src/exceptions/NotSatisfiedNodeVersion'
import { debug } from '#src/debug/index'

export class Ignite extends Macroable {
/**
Expand Down Expand Up @@ -380,15 +380,13 @@ export class Ignite extends Macroable {

if (!signals.SIGINT) {
signals.SIGINT = () => {
process.exit()
process.exit(0)
}
}

if (!signals.SIGTERM) {
signals.SIGTERM = signal => {
LoadHelper.shutdownProviders().then(() =>
process.kill(process.pid, signal)
)
signals.SIGTERM = () => {
LoadHelper.shutdownProviders().then(() => process.exit(0))
}
}

Expand Down