diff --git a/apps/redis-api/src/index.ts b/apps/redis-api/src/index.ts index 55da9a95a..a0b4de058 100644 --- a/apps/redis-api/src/index.ts +++ b/apps/redis-api/src/index.ts @@ -32,6 +32,7 @@ const app = new Elysia() set.status = 404; return getErrorReturn(error); case "INTERNAL_SERVER_ERROR": + default: set.status = 500; baseLogger.error("Internal server error", error); Sentry.captureException(error); @@ -59,7 +60,7 @@ app.listen(env.PORT, (server) => { baseLogger.debug(`🦊 REDISAPI@${env.VERSION} running on ${server.url}`); }); -function getErrorReturn(error: Error) { +function getErrorReturn(error: { toString: () => string }) { return { status: "error", message: error.toString(), diff --git a/apps/redis-api/src/routes/api/cache.ts b/apps/redis-api/src/routes/api/cache.ts index 0ea5f0fc6..f54f9f117 100644 --- a/apps/redis-api/src/routes/api/cache.ts +++ b/apps/redis-api/src/routes/api/cache.ts @@ -32,7 +32,7 @@ export const cacheRoutes = new Elysia({ prefix: "/cache" }) const output = JSON.parse(value); return { data: output }; } catch (e) { - redis.del(key); + redis.unlink(key); cacheRouteLogger.error(`Invalid JSON in cache for '${key}'`, e); Sentry.captureException(e, {