use a short-lived lock

This commit is contained in:
chrislu
2024-02-01 23:01:44 -08:00
parent 0aed16a9c4
commit d30150dde1
3 changed files with 25 additions and 38 deletions

View File

@@ -92,8 +92,8 @@ func NewMessageBroker(option *MessageQueueBrokerOption, grpcDialOption grpc.Dial
glog.V(0).Infof("BrokerConnectToBalancer: %v", err)
}
time.Sleep(time.Second)
if err := mqBroker.lockAsBalancer.DoLock(lock_manager.MaxDuration); err != nil {
glog.V(0).Infof("DoLock: %v", err)
if err := mqBroker.lockAsBalancer.AttemptToLock(lock_manager.MaxDuration); err != nil {
glog.V(0).Infof("AttemptToLock: %v", err)
}
}
}()