Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 1c4af81

Browse files
committed
perf: optimize handleGetLog
1 parent 469b5ba commit 1c4af81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ async function handleGetSingleScheduledRewards (req, res, redis) {
223223
}
224224

225225
async function handleGetLog (res, redis) {
226-
json(res, (await redis.lrange('log', 0, -1)).map(JSON.parse))
226+
const log = await redis.lrange('log', 0, -1)
227+
res.setHeader('Content-Type', 'application/json')
228+
res.end(`[${log.join(',')}]`)
227229
}
228230

229231
const errorHandler = (res, err, logger) => {

0 commit comments

Comments
 (0)