Skip to content

Conversation

@pmespresso
Copy link

@pmespresso pmespresso commented Sep 27, 2024

What did I change?

  • Modify shouldRecheck function to always process non-indexed URLs
  • Ensure "Submitted and Indexed" URLs are only rechecked after cache timeout
  • Optimize batch processing to avoid unnecessary API calls

Why did I change it?

Every run on the script was trying the process the same urls and then timing out.
Related: #51 #59

- Modify shouldRecheck function to always process non-indexed URLs
- Ensure "Submitted and Indexed" URLs are only rechecked after cache timeout
- Optimize batch processing to avoid unnecessary API calls
src/index.ts Outdated

const shouldRecheck = (status: Status, lastCheckedAt: string) => {
const shouldIndexIt = indexableStatuses.includes(status);
if (status !== Status.SubmittedAndIndexed) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong, there are some statuses that should not force a recheck

or am I missing something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're right, I overfit to my own personal issue.

My cache was saving "status": "Not found (404)", which is not currently part of the Status enum, so those were being skipped.

I should rather just add a new Status.NotFound to indexableStatus.

However, such things can be fixed quite quickly but because of the long cacheTimeout they'd be ignored for 2 weeks. Perhaps we can have a shorter timeout for NotFound or PageWithRedirect.

What do you think?

…ound)

- Maintain efficient long-term caching for stable, indexed URLs
- add NotFound to Status enum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants