From feec9fc080ec64634bd6c3927a5d2cf4b73e1c9d Mon Sep 17 00:00:00 2001 From: Hasan Afzal Date: Thu, 20 Jun 2024 13:13:21 +0500 Subject: [PATCH 1/2] Enhance Cache logic to to save Api limit --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index abd6a4b..04076de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -109,7 +109,7 @@ export const index = async (input: string = process.argv[2], options: IndexOptio const shouldRecheck = (status: Status, lastCheckedAt: string) => { const shouldIndexIt = indexableStatuses.includes(status); const isOld = new Date(lastCheckedAt) < new Date(Date.now() - CACHE_TIMEOUT); - return shouldIndexIt || isOld; + return shouldIndexIt && isOld;; }; await batch( From 93dd956dca4065b97d6076db772560fba57aec50 Mon Sep 17 00:00:00 2001 From: Hasan Afzal Date: Thu, 20 Jun 2024 15:18:33 +0500 Subject: [PATCH 2/2] Add Changeset file --- .changeset/six-mirrors-double.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/six-mirrors-double.md diff --git a/.changeset/six-mirrors-double.md b/.changeset/six-mirrors-double.md new file mode 100644 index 0000000..7480b3a --- /dev/null +++ b/.changeset/six-mirrors-double.md @@ -0,0 +1,5 @@ +--- +"google-indexing-script": minor +--- + +Don't want the same URL use my API limit again until his previous cache limit is completed