From 65fcb598795e226d8a70a5040514683d6f4a3f52 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Tue, 6 Mar 2018 15:36:39 -0800 Subject: [PATCH] Making Mutex a pointer so that there's no chance it can accidentally be copied. --- realis.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/realis.go b/realis.go index befb5c1..87ca6e7 100644 --- a/realis.go +++ b/realis.go @@ -84,7 +84,7 @@ type realisClient struct { adminClient *aurora.AuroraAdminClient infoLogger Logger debugLogger Logger - lock sync.Mutex + lock *sync.Mutex } type RealisConfig struct { @@ -96,8 +96,7 @@ type RealisConfig struct { backoff Backoff transport thrift.TTransport protoFactory thrift.TProtocolFactory - infoLogger Logger - debugLogger Logger + infoLogger, debugLogger Logger InsecureSkipVerify bool certspath string clientkey, clientcert string @@ -296,7 +295,8 @@ func NewRealisClient(options ...ClientOption) (Realis, error) { readonlyClient: aurora.NewReadOnlySchedulerClientFactory(config.transport, config.protoFactory), adminClient: aurora.NewAuroraAdminClientFactory(config.transport, config.protoFactory), infoLogger: config.infoLogger, - debugLogger: config.debugLogger}, nil + debugLogger: config.debugLogger, + lock: &sync.Mutex{}}, nil } func GetDefaultClusterFromZKUrl(zkurl string) *Cluster {