Skip to content

feat: added the global timeout feature for the entire process#191

Open
Manav-Desai-07 wants to merge 2 commits intoseantomburke:masterfrom
Manav-Desai-07:feat/globalTimeout
Open

feat: added the global timeout feature for the entire process#191
Manav-Desai-07 wants to merge 2 commits intoseantomburke:masterfrom
Manav-Desai-07:feat/globalTimeout

Conversation

@Manav-Desai-07
Copy link

This PR introduces a global timeout feature for Sitemapper. The new globalTimeout option allows developers to set a maximum overall execution time for sitemap parsing. This prevents the process from running indefinitely, especially when encountering irregular or malformed sitemaps.

Changes

  • Added globalTimeout configuration option in the Sitemapper constructor.
  • Updated the fetching logic to abort ongoing requests if the global timeout is reached.
  • Added examples in the documentation for both Promise and Async/Await usage demonstrating the global timeout feature.
  • Updated README.md with new globalTimeout usage examples and notes.

Benefits:

  • Prevents infinite loops or hanging processes due to irregular sitemap structures.
  • Provides developers with greater control over resource usage and execution timing.
  • Enhances reliability for automated workflows or cron jobs using Sitemapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants