diff --git a/CHANGELOG.md b/CHANGELOG.md index 99bdd843..18174d64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## v3.0.3 - 2071-09-03 +## v3.0.4 - 2017-09-04 + +- Fixed default context timeout if one of config's timeout os omitted + +## v3.0.3 - 2017-09-03 - Added support to cancellation queries and timeouts with `context.Context` passed through `RunOpts` - Fixed import path for `sirupsen/logrus` due to repo was renamed diff --git a/README.md b/README.md index afbe1e30..a2ae71e5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ![GoRethink Logo](https://raw.github.com/wiki/gorethink/gorethink/gopher-and-thinker-s.png "Golang Gopher and RethinkDB Thinker") -Current version: v3.0.3 (RethinkDB v2.3) +Current version: v3.0.4 (RethinkDB v2.3) diff --git a/connection_helper.go b/connection_helper.go index 6590de8a..ba4ff52b 100644 --- a/connection_helper.go +++ b/connection_helper.go @@ -45,7 +45,7 @@ func (c *Connection) writeQuery(token int64, q []byte) error { func (c *Connection) contextFromConnectionOpts() context.Context { sum := c.opts.ReadTimeout + c.opts.WriteTimeout - if sum == 0 { + if c.opts.ReadTimeout == 0 || c.opts.WriteTimeout == 0 { return context.Background() } ctx, _ := context.WithTimeout(context.Background(), sum)