Making Mutex a pointer so that there's no chance it can accidentally be copied.
This commit is contained in:
parent
8d5a2d2414
commit
65fcb59879
1 changed files with 4 additions and 4 deletions
|
@ -84,7 +84,7 @@ type realisClient struct {
|
||||||
adminClient *aurora.AuroraAdminClient
|
adminClient *aurora.AuroraAdminClient
|
||||||
infoLogger Logger
|
infoLogger Logger
|
||||||
debugLogger Logger
|
debugLogger Logger
|
||||||
lock sync.Mutex
|
lock *sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
type RealisConfig struct {
|
type RealisConfig struct {
|
||||||
|
@ -96,8 +96,7 @@ type RealisConfig struct {
|
||||||
backoff Backoff
|
backoff Backoff
|
||||||
transport thrift.TTransport
|
transport thrift.TTransport
|
||||||
protoFactory thrift.TProtocolFactory
|
protoFactory thrift.TProtocolFactory
|
||||||
infoLogger Logger
|
infoLogger, debugLogger Logger
|
||||||
debugLogger Logger
|
|
||||||
InsecureSkipVerify bool
|
InsecureSkipVerify bool
|
||||||
certspath string
|
certspath string
|
||||||
clientkey, clientcert string
|
clientkey, clientcert string
|
||||||
|
@ -296,7 +295,8 @@ func NewRealisClient(options ...ClientOption) (Realis, error) {
|
||||||
readonlyClient: aurora.NewReadOnlySchedulerClientFactory(config.transport, config.protoFactory),
|
readonlyClient: aurora.NewReadOnlySchedulerClientFactory(config.transport, config.protoFactory),
|
||||||
adminClient: aurora.NewAuroraAdminClientFactory(config.transport, config.protoFactory),
|
adminClient: aurora.NewAuroraAdminClientFactory(config.transport, config.protoFactory),
|
||||||
infoLogger: config.infoLogger,
|
infoLogger: config.infoLogger,
|
||||||
debugLogger: config.debugLogger}, nil
|
debugLogger: config.debugLogger,
|
||||||
|
lock: &sync.Mutex{}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetDefaultClusterFromZKUrl(zkurl string) *Cluster {
|
func GetDefaultClusterFromZKUrl(zkurl string) *Cluster {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue