Skip to content

Commit

Permalink
Fix default parameters in ReconnectClient (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Dec 23, 2019
1 parent 05f5bc3 commit b597ede
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reconnclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type reconnectClient struct {
func NewReconnectClient(ctx context.Context, dialer Dialer, clientID string, opts ...ConnectOption) (Client, error) {
rc := &RetryClient{}

options := &ConnectOptions{}
options := &ConnectOptions{CleanSession: true}
for _, opt := range opts {
if err := opt(options); err != nil {
return nil, err
Expand All @@ -39,7 +39,7 @@ func NewReconnectClient(ctx context.Context, dialer Dialer, clientID string, opt
var doneOnce sync.Once
go func() {
clean := options.CleanSession
reconnWaitBase := 100 * time.Millisecond
reconnWaitBase := time.Second
reconnWaitMax := 10 * time.Second
reconnWait := reconnWaitBase
for {
Expand Down

0 comments on commit b597ede

Please sign in to comment.