-
Notifications
You must be signed in to change notification settings - Fork 281
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
Adding context to database provider #1118
Adding context to database provider #1118
Conversation
Hey @mfreeman451, the mocks have not been updated, but before that can we discuss some approaches and implementations? I feel like One other train of thought would be to FATAL log the errors, as it would panic the code even if it starts as the handler might expect the databases to be connected. |
…o bug/mongodb_context
@mfreeman451 can you fix the reveiw comments? |
pkg/gofr/datasource/mongo/mongo.go
Outdated
func (*Client) isTimeoutError(err error) bool { | ||
return strings.Contains(err.Error(), "connection timeout") || mongo.IsTimeout(err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1118 (comment)
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
cleaned up and updated |
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Hey @mfreeman451, I was going through the code and I believe the current implementation might introduce a breaking change. To prevent that, here's what I suggest:
I believe the approach I suggested is one way to address this. However, if you have a better or more efficient solution, feel free to go ahead and use it to resolve the issue. I’m open to exploring alternatives that might work better for the use case. Let me know your thoughts on this! |
@mfreeman451 are you proceeding towards the review-changes suggested by @coolwednesday ? |
Please reopen once the changes are fixed and comments are resolved as it has been more than 2 weeks of last activity. |
Pull Request Template
Description:
Breaking Changes (if applicable):
Additional Information:
Checklist:
goimport
andgolangci-lint
.Thank you for your contribution!