Skip to content

Commit

Permalink
fix: Reduce cache from 24 hours to 1 hour
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Apr 16, 2024
1 parent 90e10fe commit f564997
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/services/chrome-service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { chrome } from "../crawlers";
import { createCachedDataLoader } from "../utils/cache";
import { DAY_MS } from "../utils/time";
import { HOUR_MS } from "../utils/time";

export function createChromeService() {
const loader = createCachedDataLoader<
string,
Gql.ChromeExtension | undefined
>(DAY_MS, (ids) =>
>(HOUR_MS, (ids) =>
Promise.all(ids.map((id) => chrome.crawlExtension(id, "en"))),
);

Expand Down
4 changes: 2 additions & 2 deletions src/services/firefox-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFirefoxApiClient } from "../apis";
import { DAY_MS } from "../utils/time";
import { HOUR_MS } from "../utils/time";
import { createCachedDataLoader } from "../utils/cache";

export function createFirefoxService() {
Expand All @@ -8,7 +8,7 @@ export function createFirefoxService() {
const loader = createCachedDataLoader<
string | number,
Gql.FirefoxAddon | undefined
>(DAY_MS, (ids) => Promise.all(ids.map((id) => firefox.getAddon(id))));
>(HOUR_MS, (ids) => Promise.all(ids.map((id) => firefox.getAddon(id))));

return {
getAddon: (id: string | number) => loader.load(id),
Expand Down

0 comments on commit f564997

Please sign in to comment.