Skip to content

Improve code resiliency#85

Merged
digizeph merged 2 commits intomainfrom
feature/crawler-resiliency
Dec 1, 2025
Merged

Improve code resiliency#85
digizeph merged 2 commits intomainfrom
feature/crawler-resiliency

Conversation

@digizeph
Copy link
Member

@digizeph digizeph commented Dec 1, 2025

This pull request introduces significant improvements to error handling throughout the codebase, adds new configuration options for crawler retry logic and database maintenance, and improves documentation accordingly. The main focus is on replacing .unwrap() calls with proper error handling, making the CLI and API more robust and user-friendly. Additionally, the crawler and database maintenance processes are now more configurable and resilient.

Error Handling Improvements

  • Replaced all .unwrap() calls with proper error handling across the CLI, API, and background tasks, ensuring that errors are logged with informative messages and the application exits gracefully when necessary. This affects database operations, file downloads, collector loading, and time parsing.

  • Added a Clippy lint to deny the use of unwrap in future code (Cargo.toml).

Crawler and Database Maintenance Enhancements

  • Added retry logic with exponential backoff for failed HTTP requests in the crawler, configurable via BGPKIT_BROKER_CRAWLER_MAX_RETRIES and BGPKIT_BROKER_CRAWLER_BACKOFF_MS environment variables.

  • Implemented automatic cleanup of old meta table entries after each database update, with retention configurable via BGPKIT_BROKER_META_RETENTION_DAYS.

Documentation Updates

  • Updated CHANGELOG.md and README.md to document new configuration options and summarize the error handling improvements and new features.

- Introduce exponential backoff with configurable retries for failed HTTP requests in the crawler.
- Add automatic cleanup of meta table entries older than a configurable retention period.
- Update README and CHANGELOG with new configuration details.
- Replaced `.unwrap()` across the codebase with proper error handling to prevent panics.
- Improved logging for failed operations in CLI, database, crawlers, and API.
- Updated error messaging for better debugging.
- Enforced `unwrap_used = "deny"` in lint configuration.
- Added detailed CHANGELOG updates.
@digizeph digizeph enabled auto-merge (rebase) December 1, 2025 06:05
@digizeph digizeph merged commit ecf4411 into main Dec 1, 2025
1 check passed
@digizeph digizeph deleted the feature/crawler-resiliency branch December 1, 2025 06:08
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.

1 participant