Skip to content

Commit 340fe37

Browse files
author
Yash Agrawal
committed
fix: close redit client properly
1 parent 2e53259 commit 340fe37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pages/api/send-transactions/AchievementsSBT/[contract].ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,16 @@ export const POST: APIRoute = async ({
188188
),
189189
)
190190

191-
const result = await whenNotErrorAll([redis, saved], ([db]) =>
191+
const result = await whenNotErrorAll([redis], ([db]) =>
192192
db
193193
.quit()
194194
.then((x) => x)
195195
.catch((err: Error) => err),
196196
)
197197

198-
return result instanceof Error || sbtToBeMinted instanceof Error
198+
return result instanceof Error ||
199+
sbtToBeMinted instanceof Error ||
200+
saved instanceof Error
199201
? new Response(json({ message: 'Error occured', error: true }), {
200202
status: 500,
201203
headers,

0 commit comments

Comments
 (0)