Skip to content

Commit 2688eb5

Browse files
committed
fix: review comments
1 parent f2c0a59 commit 2688eb5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

apps/indexer/src/app/plugins/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ const redisCachePlugin: FastifyPluginAsync<RedisCachePluginOptions> = async (
238238

239239
if (!key) return payload;
240240

241-
// By default, don't cache error responses
242-
if (reply.statusCode >= 400) return payload;
241+
// By default, don't cache server error responses (5xx)
242+
if (reply.statusCode >= 500) return payload;
243243

244244
const ttl = cfg.ttlSeconds ?? defaultTtl;
245245

apps/web-app/src/components/FormComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export function AmountField({
247247
{balance && (
248248
<span className="ml-2 text-sm font-normal text-gray-400">
249249
(Balance:{' '}
250-
{Decimal.from(balance.value, balance.decimals).toFormatted(88)}{' '}
250+
{Decimal.from(balance.value, balance.decimals).toFormatted()}{' '}
251251
{balance.symbol})
252252
</span>
253253
)}

apps/web-app/src/routes/money-market.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { useQuery } from '@tanstack/react-query';
2222
import { useMemo } from 'react';
2323
import z from 'zod';
2424

25+
const STALE_TIME = 1000 * 60 * 60; // 1 hour
26+
2527
const poolSearchSchema = z.object({
2628
offset: z.number().min(0).default(0),
2729
limit: z.number().min(1).max(100).default(20),
@@ -43,13 +45,13 @@ export const Route = createFileRoute('/money-market')({
4345
client.prefetchQuery({
4446
queryKey: ['money-market:pools'],
4547
queryFn: () => sdk.moneyMarket.listPools(),
46-
staleTime: 1000 * 60 * 60, // 1 hour
48+
staleTime: STALE_TIME,
4749
});
4850

4951
client.prefetchQuery({
5052
queryKey: ['money-market:reserve', pool || 'default'],
5153
queryFn: () => sdk.moneyMarket.listReserves(pool || 'default'),
52-
staleTime: 1000 * 60 * 60, // 1 hour
54+
staleTime: STALE_TIME,
5355
});
5456
},
5557
});
@@ -66,7 +68,7 @@ function RouteComponent() {
6668
const { data: reserves } = useQuery({
6769
queryKey: ['money-market:reserve', pool || 'default'],
6870
queryFn: () => sdk.moneyMarket.listReserves(pool || 'default'),
69-
staleTime: 1000 * 60 * 60, // 1 hour
71+
staleTime: STALE_TIME,
7072
});
7173

7274
const borrowAssets = useMemo(

0 commit comments

Comments
 (0)