lab4: вложения (proxy upload, download, уборщик), attachment_ids в сообщениях
This commit is contained in:
+15
-1
@@ -16,6 +16,18 @@ async function bootstrap(): Promise<void> {
|
||||
AppModule,
|
||||
new FastifyAdapter({ logger: true }),
|
||||
);
|
||||
// Raw image bodies reach the controller as an unread stream: the upload is
|
||||
// bounded by our own checks, not by Fastify's bodyLimit.
|
||||
app.getHttpAdapter()
|
||||
.getInstance()
|
||||
.addContentTypeParser(
|
||||
['image/png', 'image/jpeg'],
|
||||
(
|
||||
_request: unknown,
|
||||
payload: unknown,
|
||||
done: (error: Error | null, body?: unknown) => void,
|
||||
) => done(null, payload),
|
||||
);
|
||||
app.useGlobalInterceptors(
|
||||
new RequestIdInterceptor(
|
||||
app.get(HttpAdapterHost),
|
||||
@@ -50,7 +62,9 @@ async function bootstrap(): Promise<void> {
|
||||
shuttingDown = true;
|
||||
health.setDraining();
|
||||
if (drainDelayMs > 0)
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, drainDelayMs));
|
||||
await new Promise<void>((resolve) =>
|
||||
setTimeout(resolve, drainDelayMs),
|
||||
);
|
||||
await app.close();
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user