Skip to content

Commit

Permalink
remove cache in module
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano committed Feb 13, 2025
1 parent 12c60e4 commit 5f8b979
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions linx/loaders/auction/apiList.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Auction } from "../../utils/types/auctionAPI.ts";
import type { AppContext } from "../../../linx/mod.ts";

let cachedPromise: Promise<Auction[]> | null = null;
let lastUpdate: number = Date.now();
/**
* @title Linx Integration
* @description Search Wishlist loader
Expand All @@ -14,11 +12,6 @@ const loader = (
): Promise<Auction[] | null> => {
const { layer } = ctx;

if (cachedPromise && Date.now() - lastUpdate < (60 * 1000)) {
return cachedPromise;
}

lastUpdate = Date.now();
const responsePromise = layer
["POST /v1/Catalog/API.svc/web/SearchProductAuctions"](
{},
Expand All @@ -28,7 +21,6 @@ const loader = (
return await response.json();
});

cachedPromise = responsePromise;
return responsePromise;
};

Expand Down

0 comments on commit 5f8b979

Please sign in to comment.