Skip to content

feature/get-timeout-from-db-client#4

Merged
cedricve merged 1 commit intomainfrom
feature/get-timeout-from-db-client
Jan 20, 2026
Merged

feature/get-timeout-from-db-client#4
cedricve merged 1 commit intomainfrom
feature/get-timeout-from-db-client

Conversation

@cedricve
Copy link
Member

@cedricve cedricve commented Jan 20, 2026

Description

Pull Request: feature/get-timeout-from-db-client

Description

This pull request introduces a new method to the MongoClient class that allows retrieval of the timeout duration configured for the MongoDB client. The following changes are made to enhance the functionality of the database client:

  1. Addition of GetTimeout Method:

    • A new method, GetTimeout, is added to the MongoClient class. This method returns the timeout duration for the MongoDB client in milliseconds, providing a straightforward way to access this configuration.
  2. Documentation Updates:

    • Added comments for the Ping and GetTimeout methods to improve code readability and maintainability.

Motivation

The primary motivation behind this change is to improve the configurability and introspection capabilities of the MongoDB client within our project. By exposing the timeout configuration, developers can better understand and manage the database client's behavior, particularly in scenarios involving network latency and server responsiveness.

Benefits

  • Enhanced Debugging and Monitoring: Access to timeout values allows for better debugging and monitoring of database interactions, helping to identify and resolve issues related to connectivity and performance.
  • Improved Code Readability: Adding comments to the methods enhances code documentation, making it easier for developers to understand the purpose and usage of each method.
  • Configurability: Exposing the timeout configuration provides flexibility in managing and adjusting the client's behavior according to different environments and requirements.

Overall, this change improves the project's robustness and maintainability by providing essential insights into the database client's configuration.

Introduces a GetTimeout method to MongoClient for retrieving the configured timeout duration. Also adds a comment to the Ping method for clarity.
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/database/mongodb.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@cedricve cedricve merged commit ab500dc into main Jan 20, 2026
6 checks passed
@cedricve cedricve deleted the feature/get-timeout-from-db-client branch January 20, 2026 20:04
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