Преглед на файлове

refactor: file structure

Alexandru Cambose преди 3 месеца
родител
ревизия
896aedeeb1

+ 1 - 1
apps/insights/src/utils/cache.ts → apps/insights/src/cache.ts

@@ -2,7 +2,7 @@ import type { Cache as ACDCache } from "async-cache-dedupe";
 import { createCache } from "async-cache-dedupe";
 import { stringify, parse } from "superjson";
 
-import { getRedis } from "../config/server";
+import { getRedis } from "./config/server";
 
 const transformer = {
   serialize: stringify,

+ 0 - 0
apps/insights/src/utils/get-host.ts → apps/insights/src/get-host.ts


+ 2 - 2
apps/insights/src/server/pyth.ts

@@ -1,10 +1,10 @@
 import { parse } from "superjson";
 import { z } from "zod";
 
+import { DEFAULT_CACHE_TTL } from "../cache";
 import { VERCEL_REQUEST_HEADERS } from "../config/server";
+import { getHost } from "../get-host";
 import { Cluster, ClusterToName, priceFeedsSchema } from "../services/pyth";
-import { DEFAULT_CACHE_TTL } from "../utils/cache";
-import { getHost } from "../utils/get-host";
 
 export async function getPublishersForFeedRequest(
   cluster: Cluster,

+ 1 - 1
apps/insights/src/services/clickhouse.ts

@@ -5,8 +5,8 @@ import type { ZodSchema, ZodTypeDef } from "zod";
 import { z } from "zod";
 
 import { Cluster, ClusterToName } from "./pyth";
+import { redisCache } from "../cache";
 import { CLICKHOUSE } from "../config/server";
-import { redisCache } from "../utils/cache";
 
 const client = createClient(CLICKHOUSE);
 

+ 1 - 1
apps/insights/src/services/pyth/get-feeds.ts

@@ -1,6 +1,6 @@
 import { Cluster, priceFeedsSchema } from ".";
 import { getPythMetadataCached } from "./get-metadata";
-import { redisCache } from "../../utils/cache";
+import { redisCache } from "../../cache";
 
 const _getFeeds = async (cluster: Cluster) => {
   const unfilteredData = await getPythMetadataCached(cluster);

+ 1 - 1
apps/insights/src/services/pyth/get-metadata.ts

@@ -1,5 +1,5 @@
 import { clients, Cluster } from ".";
-import { memoryOnlyCache } from "../../utils/cache";
+import { memoryOnlyCache } from "../../cache";
 
 const getPythMetadata = async (cluster: Cluster) => {
   return clients[cluster].getData();

+ 1 - 1
apps/insights/src/services/pyth/get-publishers-for-cluster.ts

@@ -1,6 +1,6 @@
 import { Cluster } from ".";
 import { getPythMetadataCached } from "./get-metadata";
-import { redisCache } from "../../utils/cache";
+import { redisCache } from "../../cache";
 
 const _getPublishersForCluster = async (cluster: Cluster) => {
   const data = await getPythMetadataCached(cluster);