Skip to content

Commit a5695d4

Browse files
author
Aleksander Mogilko
committed
fix default context timeout if one of config's timeout is omitted
1 parent 24747b4 commit a5695d4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## v3.0.3 - 2071-09-03
5+
## v3.0.4 - 2017-09-04
6+
7+
- Fixed default context timeout if one of config's timeout os omitted
8+
9+
## v3.0.3 - 2017-09-03
610

711
- Added support to cancellation queries and timeouts with `context.Context` passed through `RunOpts`
812
- Fixed import path for `sirupsen/logrus` due to repo was renamed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
![GoRethink Logo](https://raw.github.com/wiki/gorethink/gorethink/gopher-and-thinker-s.png "Golang Gopher and RethinkDB Thinker")
1111

12-
Current version: v3.0.3 (RethinkDB v2.3)
12+
Current version: v3.0.4 (RethinkDB v2.3)
1313

1414
<!-- This project is no longer maintained, for more information see the [v3.0.0 release](https://github.com/gorethink/gorethink/releases/tag/v3.0.0)-->
1515

connection_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (c *Connection) writeQuery(token int64, q []byte) error {
4545

4646
func (c *Connection) contextFromConnectionOpts() context.Context {
4747
sum := c.opts.ReadTimeout + c.opts.WriteTimeout
48-
if sum == 0 {
48+
if c.opts.ReadTimeout == 0 || c.opts.WriteTimeout == 0 {
4949
return context.Background()
5050
}
5151
ctx, _ := context.WithTimeout(context.Background(), sum)

0 commit comments

Comments
 (0)