File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ func CreateCluster() *gocql.ClusterConfig {
51
51
cluster .Timeout = * flagTimeout
52
52
cluster .Consistency = gocql .Quorum
53
53
cluster .MaxWaitSchemaAgreement = 2 * time .Minute // travis might be slow
54
+ cluster .ReconnectionPolicy = & gocql.ConstantReconnectionPolicy {
55
+ MaxRetries : 10 ,
56
+ Interval : 3 * time .Second ,
57
+ }
54
58
if * flagRetry > 0 {
55
59
cluster .RetryPolicy = & gocql.SimpleRetryPolicy {NumRetries : * flagRetry }
56
60
}
Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ func (q *Queryx) RoutingKey(routingKey []byte) *Queryx {
86
86
// query, queries will be canceled and return once the context is
87
87
// canceled.
88
88
func (q * Queryx ) WithContext (ctx context.Context ) * Queryx {
89
+ if ctx == nil {
90
+ ctx = context .Background ()
91
+ }
89
92
q .Query = q .Query .WithContext (ctx )
90
93
return q
91
94
}
You can’t perform that action at this time.
0 commit comments