Skip to content

Commit 0430f3f

Browse files
chore: resolve conflicts
2 parents 5045fea + e33be81 commit 0430f3f

56 files changed

Lines changed: 2188 additions & 1912 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
with:
2626
# We must fetch at least the immediate parents so that if this is
2727
# a pull request then we can checkout the head.

integration/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ services:
5151
zookeeper:
5252
container_name: test-zookeeper
5353
hostname: zookeeper
54-
image: confluentinc/cp-zookeeper:7.9.4
54+
image: confluentinc/cp-zookeeper:7.9.5
5555
ports:
5656
- "2181:2181"
5757
environment:
@@ -60,7 +60,7 @@ services:
6060
kafka:
6161
container_name: test-kafka
6262
hostname: kafka
63-
image: confluentinc/cp-kafka:8.1.0
63+
image: confluentinc/cp-kafka:8.1.1
6464
depends_on:
6565
- zookeeper
6666
ports:

integration/hooks/e2e/enable-shutdown-hook.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,21 @@ describe('enableShutdownHooks', () => {
5151
expect(result.stdout.toString().trim()).to.be.eq('');
5252
done();
5353
}).timeout(10000);
54+
55+
it('should call the correct hooks with useProcessExit option', done => {
56+
const result = spawnSync('ts-node', [
57+
join(__dirname, '../src/enable-shutdown-hooks-main.ts'),
58+
'SIGHUP',
59+
'SIGHUP',
60+
'graceful',
61+
]);
62+
const calls = result.stdout
63+
.toString()
64+
.split('\n')
65+
.map((call: string) => call.trim());
66+
expect(calls[0]).to.equal('beforeApplicationShutdown SIGHUP');
67+
expect(calls[1]).to.equal('onApplicationShutdown SIGHUP');
68+
expect(result.status).to.equal(0);
69+
done();
70+
}).timeout(10000);
5471
});

integration/hooks/src/enable-shutdown-hooks-main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { NestFactory } from '@nestjs/core';
88
const SIGNAL = process.argv[2];
99
const SIGNAL_TO_LISTEN = process.argv[3];
10+
const USE_GRACEFUL_EXIT = process.argv[4] === 'graceful';
1011

1112
@Injectable()
1213
class TestInjectable
@@ -29,10 +30,12 @@ class AppModule {}
2930
async function bootstrap() {
3031
const app = await NestFactory.create(AppModule, { logger: false });
3132

33+
const shutdownOptions = USE_GRACEFUL_EXIT ? { useProcessExit: true } : {};
34+
3235
if (SIGNAL_TO_LISTEN && SIGNAL_TO_LISTEN !== 'NONE') {
33-
app.enableShutdownHooks([SIGNAL_TO_LISTEN]);
36+
app.enableShutdownHooks([SIGNAL_TO_LISTEN], shutdownOptions);
3437
} else if (SIGNAL_TO_LISTEN !== 'NONE') {
35-
app.enableShutdownHooks();
38+
app.enableShutdownHooks([], shutdownOptions);
3639
}
3740

3841
await app.listen(1800);

0 commit comments

Comments
 (0)