Skip to content

Commit

Permalink
fix: remove unnecessary fork for unpaged result
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Feb 19, 2024
1 parent 611f2d5 commit c446075
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/routes/txs/hash/required-signers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,7 @@ async function route(fastify: FastifyInstance) {
return reply.send([]);
}

const unpaged = isUnpaged(request);

if (unpaged) {
// Use of Reply.raw functions is at your own risk as you are skipping all the Fastify logic of handling the HTTP response
// https://www.fastify.io/docs/latest/Reference/Reply/#raw
reply.raw.writeHead(200, { 'Content-Type': 'application/json' });
await toJSONStream(rows, reply.raw);
return reply;
} else {
return reply.send(rows);
}
return reply.send(rows);
} catch (error) {
if (clientDbSync) {
clientDbSync.release();
Expand Down

0 comments on commit c446075

Please sign in to comment.