Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat graceful shutdown 終了時に穏便に死ぬようにする #11734

Closed
Closed
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
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devDependencies になっています

"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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいですが、誤字の修正をお願いします~!
fasitfyfastify

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