Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/insights/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ const transformer = {
deserialize: parse,
};

export const DEFAULT_CACHE_TTL = 3600; // 1 hour
export const DEFAULT_CACHE_STALE = 86_400; // 24 hours
// export const DEFAULT_CACHE_TTL = 3600; // 1 hour
// export const DEFAULT_CACHE_STALE = 86_400; // 24 hours


export const DEFAULT_CACHE_TTL = 60; // 1 minute
export const DEFAULT_CACHE_STALE = 60; // 1 minute

export const redisCache: ACDCache = createCache({
transformer,
Expand Down
12 changes: 6 additions & 6 deletions apps/insights/src/services/pyth/get-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { clients, Cluster } from ".";
import { memoryOnlyCache } from "../../cache";
// import { memoryOnlyCache } from "../../cache";

const getPythMetadata = async (cluster: Cluster) => {
export const getPythMetadataCached = async (cluster: Cluster) => {
return clients[cluster].getData();
};

export const getPythMetadataCached = memoryOnlyCache.define(
"getPythMetadata",
getPythMetadata,
).getPythMetadata;
// export const getPythMetadataCached = memoryOnlyCache.define(
// "getPythMetadata",
// getPythMetadata,
// ).getPythMetadata;
Loading