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

add timeout in mongo config and add Ping after connect #1230

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

Umang01-hash
Copy link
Contributor

@Umang01-hash Umang01-hash commented Nov 20, 2024

Pull Request Template

Description:

  • Add ConnectionTimeout config in mongo.Conifg to set timeout through context.
  • Resolve issue mongo driver doesnt support contexts #1117.
  • Add call to Ping method after calling mongo.Connect to ensure successful connection and log in case of error.

Logs Before:

Screenshot 2024-11-20 at 2 51 09 PM

Logs After:

Screenshot 2024-11-20 at 2 51 52 PM Screenshot 2024-11-20 at 2 52 44 PM

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

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