|
1 | 1 | import jsdom from "jsdom"; |
2 | 2 |
|
3 | | -import { deleteAllDiscs, getAllDiscs, insertDiscs, revalidateDiscItCache } from "./api"; |
| 3 | +import { deleteAllDiscs, getAllDiscs, insertDiscs } from "./api"; |
4 | 4 | import { Config } from "./config"; |
5 | 5 | import { DISC_FETCH_URL, Site } from "./constants"; |
6 | 6 | import { |
@@ -31,7 +31,6 @@ export const refreshDiscs = async () => { |
31 | 31 | if (discsToInsert.length >= existingDiscs.length) { |
32 | 32 | await doDeleteAllDiscs(); |
33 | 33 | await doInsertDiscs(discsToInsert); |
34 | | - await doRevalidateDiscItCache(); |
35 | 34 | } else { |
36 | 35 | console.log("Database is up-to-date. No further action needed."); |
37 | 36 | } |
@@ -217,18 +216,3 @@ const doInsertDiscs = async (discsToInsert: IDisc[]) => { |
217 | 216 | throw new Error(`${error} - Error inserting discs into database.`); |
218 | 217 | } |
219 | 218 | }; |
220 | | - |
221 | | -const doRevalidateDiscItCache = async () => { |
222 | | - try { |
223 | | - if (!Config.DISCIT_URL) { |
224 | | - console.log("DISCIT_URL env var is not defined. Skipping DiscIt cache revalidation."); |
225 | | - return; |
226 | | - } |
227 | | - console.log("Revalidating DiscIt cache..."); |
228 | | - const { ok, status } = await revalidateDiscItCache(); |
229 | | - if (!ok) throw `Bad response status: ${status}`; |
230 | | - console.log("DiscIt cache revalidated."); |
231 | | - } catch (error) { |
232 | | - throw new Error(`${error} - Error revalidating DiscIt cache.`); |
233 | | - } |
234 | | -}; |
0 commit comments