Skip to content

Commit e49a653

Browse files
authored
Merge pull request #62 from hasanafzal8485/refine-index-check
Enhance Cache logic to to save Api limit
2 parents d6617fb + 93dd956 commit e49a653

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/six-mirrors-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"google-indexing-script": minor
3+
---
4+
5+
Don't want the same URL use my API limit again until his previous cache limit is completed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const index = async (input: string = process.argv[2], options: IndexOptio
109109
const shouldRecheck = (status: Status, lastCheckedAt: string) => {
110110
const shouldIndexIt = indexableStatuses.includes(status);
111111
const isOld = new Date(lastCheckedAt) < new Date(Date.now() - CACHE_TIMEOUT);
112-
return shouldIndexIt || isOld;
112+
return shouldIndexIt && isOld;;
113113
};
114114

115115
await batch(

0 commit comments

Comments
 (0)