Skip to content

Commit

Permalink
fix: altered orders cache to be more responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Aug 28, 2024
1 parent 843bb07 commit 756cd1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function getOrderbookActiveOrdersSQS({
return cachified({
cache: activeOrdersCache,
key: `orderbookActiveOrders-sqs-${userOsmoAddress}`,
ttl: 5000, // 5 seconds
ttl: 1000, // 1 second
getFreshValue: () =>
queryActiveOrdersSQS({
userOsmoAddress,
Expand Down
6 changes: 2 additions & 4 deletions packages/web/hooks/limit-orders/use-orderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ export const useOrderbookAllActiveOrders = ({

const refetchOrders = useCallback(async () => {
if (isRefetching) return;

return refetch();
console.log("REFETCHING");
await refetch();
}, [refetch, isRefetching]);

return {
Expand Down Expand Up @@ -356,8 +356,6 @@ export const useOrderbookClaimableOrders = ({
enabled: !!userAddress && addresses.length > 0 && !disabled,
refetchOnMount: true,
keepPreviousData: false,
cacheTime: refetchInterval,
staleTime: refetchInterval,
trpc: {
abortOnUnmount: true,
context: {
Expand Down

0 comments on commit 756cd1e

Please sign in to comment.