Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added connection logging retrying and backoff - mongodb #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ARYPROGRAMMER
Copy link
Contributor

Description

Exponential Backoff: Implemented exponential_backoff function to delay retries.
Retry Limits: Added MAX_RETRIES (5 attempts) to limit retries.
Error Handling: Handled ConnectionFailure and ServerSelectionTimeoutError.
Logging: Added logs for retry attempts, delays, and connection success/failure.
Timeout Configurations: Set connectTimeoutMS (5000ms) and socketTimeoutMS (10000ms).
Environment Variable Check: Validated presence of MONGODB_URL.
Index Creation: Ensured proper database indexes for the products collection.
Resource Cleanup: Used client.close() to release resources.

Related Issue

Fixes #13 and closes it

Motivation and Context

Implements a clear robust and clarified connection system to help future expansions, working and readability

How Has This Been Tested?

On Local Machine

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist:

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

@Varsha-1605
Copy link
Owner

@ARYPROGRAMMER why have you removed entire indexing ????

@ARYPROGRAMMER
Copy link
Contributor Author

Give me few hours I am not on system. Maybe I thought something regarding that.

@ARYPROGRAMMER why have you removed entire indexing ????

Signed-off-by: Arya Pratap Singh <[email protected]>
@ARYPROGRAMMER
Copy link
Contributor Author

@Varsha-1605 check once I have multiple branches setup and separate debugging console. it got mixed up and older one got pushed. hope this corrects it

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.

[Custom Issue]: Implement Connection Logging System
2 participants