-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 support for InfiniteTimeSpan
in SetCommandTimeout
.
#25085
Conversation
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.
This change isn't correct: passing null to the overload which accepts an int?
doesn't apply an infinite timeout - it applies "the default value used is defined by the underlying ADO.NET data provider" (see the XML docs there).
As per the documentation on DbCommand.CommandTimeout, for an infinite timeout we should set to 0.
src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Shay Rojansky <roji@roji.org>
Requested changes done, |
@roji Requested changes applied. |
Can you please add some testing in CommandConfigurationTests.CommandTimeout? |
Hello @roji, Thanks for your note. Tests added and checked as successful ;) |
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.
Thanks, I split out a separate test but otherwise all looks good.
Add support for
InfiniteTimeSpan
InContext.Database.SetCommandTimeout()
.resolves #25068 Comment 858547728