Skip to content

Commit

Permalink
feat: run shutdown handlers in local mode
Browse files Browse the repository at this point in the history
BREAKING CHANGE: running shutdown handlers in local mode
  • Loading branch information
gajus committed Jun 5, 2023
1 parent 85c138f commit ca5d6f5
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/factories/createLightship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,17 @@ export const createLightship = async (
}, 1_000).unref();
};

if (modeIsLocal) {
log.warn('shutdown handlers are not used in the local mode');
} else {
for (const signal of configuration.signals) {
process.on(signal, () => {
log.debug(
{
signal,
},
'received a shutdown signal',
);
for (const signal of configuration.signals) {
process.on(signal, () => {
log.debug(
{
signal,
},
'received a shutdown signal',
);

void shutdown(false);
});
}
void shutdown(false);
});
}

const createBeacon = (context?: BeaconContext): BeaconController => {
Expand Down

0 comments on commit ca5d6f5

Please sign in to comment.