From 6ac37b4d6cae064545b13fd7fdb414d0cffa178b Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Tue, 1 Apr 2025 20:47:04 -0400 Subject: lint and type fixes --- packages/backend/src/server/ServerService.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'packages/backend/src/server/ServerService.ts') diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index 9ae8f2efe4..c90c206e94 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -229,12 +229,12 @@ export class ServerService implements OnApplicationShutdown { } }); - fastify.get<{ Params: { x: string } }>('/identicon/:x', async (request, reply) => { - reply.header('Content-Type', 'image/png'); + fastify.get<{ Params: { x: string } }>('/identicon/:x', (request, reply) => { + reply.header('Content-Type', 'image/png'); reply.header('Cache-Control', 'public, max-age=86400'); if (this.meta.enableIdenticonGeneration) { - return await genIdenticon(request.params.x); + return genIdenticon(request.params.x); } else { return reply.redirect('/static-assets/avatar.png'); } @@ -293,13 +293,14 @@ export class ServerService implements OnApplicationShutdown { if (fs.existsSync(this.config.socket)) { fs.unlinkSync(this.config.socket); } - fastify.listen({ path: this.config.socket }, (err, address) => { - if (this.config.chmodSocket) { - fs.chmodSync(this.config.socket!, this.config.chmodSocket); - } - }); + + await fastify.listen({ path: this.config.socket }); + + if (this.config.chmodSocket) { + fs.chmodSync(this.config.socket!, this.config.chmodSocket); + } } else { - fastify.listen({ port: this.config.port, host: this.config.address }); + await fastify.listen({ port: this.config.port, host: this.config.address }); } await fastify.ready(); -- cgit v1.2.3-freya