Skip to content

Commit

Permalink
fix default context timeout if one of config's timeout is omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Mogilko committed Sep 4, 2017
1 parent 24747b4 commit a5695d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- 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)-->

Expand Down
2 changes: 1 addition & 1 deletion connection_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a5695d4

Please sign in to comment.