Skip to content

Commit

Permalink
graceful shutdown できるようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitriin committed Aug 17, 2023
1 parent dd1783f commit a306f37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"eslint": "8.46.0",
"eslint-plugin-import": "2.28.0",
"execa": "7.2.0",
"fastify-graceful-shutdown": "^3.5.1",
"jest": "29.6.2",
"jest-mock": "29.6.2",
"simple-oauth2": "5.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/server/ServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FileServerService } from './FileServerService.js';
import { ClientServerService } from './web/ClientServerService.js';
import { OpenApiServerService } from './api/openapi/OpenApiServerService.js';
import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js';

import fasitfyGracefulShutdown from "fastify-graceful-shutdown"
const _dirname = fileURLToPath(new URL('.', import.meta.url));

@Injectable()
Expand Down Expand Up @@ -100,6 +100,7 @@ export class ServerService implements OnApplicationShutdown {
fastify.register(this.nodeinfoServerService.createServer);
fastify.register(this.wellKnownServerService.createServer);
fastify.register(this.oauth2ProviderService.createServer);
fastify.register(fasitfyGracefulShutdown)

fastify.get<{ Params: { path: string }; Querystring: { static?: any; badge?: any; }; }>('/emoji/:path(.*)', async (request, reply) => {
const path = request.params.path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import MainStreamConnection from './stream/index.js';
import { ChannelsService } from './stream/ChannelsService.js';
import type * as http from 'node:http';


@Injectable()
export class StreamingApiServerService {
#wss: WebSocket.WebSocketServer;
Expand Down

0 comments on commit a306f37

Please sign in to comment.