github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/migration/dialopts.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package migration
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/juju/juju/api"
    10  )
    11  
    12  // ControllerDialOpts returns dial parameters suitable for connecting
    13  // from the source controller to the target controller during model
    14  // migrations. The total attempt time can't be too long because the
    15  // areas of the code which make these connections need to be
    16  // interruptable but a number of retries is useful to deal with short
    17  // lived issues.
    18  func ControllerDialOpts() api.DialOpts {
    19  	return api.DialOpts{
    20  		DialAddressInterval: 50 * time.Millisecond,
    21  		Timeout:             1 * time.Second,
    22  		RetryDelay:          100 * time.Millisecond,
    23  	}
    24  }