@oslokommune/auth-bff 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -81,7 +81,7 @@ WORKDIR /application
81
81
  EXPOSE 8080
82
82
  COPY --from=build /home/app/dist /application/dist
83
83
  ENV NODE_ENV=production
84
- RUN npm install -g @oslokommune/auth-bff@2.1.0
84
+ RUN npm install -g @oslokommune/auth-bff@<version>
85
85
  COPY bff.config.json /application/
86
86
  CMD ["auth-bff"]
87
87
  ```
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/auth-bff",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "repository": "https://github.com/oslokommune/auth-bff.git",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,7 +29,7 @@ export class OpenIdConfigManager {
29
29
  if (__classPrivateFieldGet(this, _OpenIdConfigManager_bffConfig, "f").okDataIdPortenKeyName) {
30
30
  setInterval(async () => {
31
31
  await this.updateOpenIdConfig();
32
- }, 5 * 60 * 1000);
32
+ }, 5 * 60 * 1000).unref();
33
33
  }
34
34
  }
35
35
  async updateOpenIdConfig() {
@@ -35,9 +35,15 @@ app.use(basePath, staticRoutes(config));
35
35
  const server = app.listen(port, () => {
36
36
  console.log(`auth-bff ${packageJson.version} started on port ${port}`);
37
37
  });
38
- process.on('SIGTERM', () => {
39
- console.log('SIGTERM received. Closing...');
38
+ const shutdown = (signal) => {
39
+ console.log(`${signal} received. Closing...`);
40
40
  server.close(() => {
41
41
  console.log('Server closed');
42
42
  });
43
- });
43
+ setTimeout(() => {
44
+ console.warn('Forced shutdown after timeout');
45
+ process.exit();
46
+ }, 10000).unref();
47
+ };
48
+ process.on('SIGTERM', () => shutdown('SIGTERM'));
49
+ process.on('SIGINT', () => shutdown('SIGINT'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/auth-bff",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "repository": "https://github.com/oslokommune/auth-bff.git",
5
5
  "publishConfig": {
6
6
  "access": "public"