aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient/exclusive_locks/exclusive_locker.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/wdclient/exclusive_locks/exclusive_locker.go')
-rw-r--r--weed/wdclient/exclusive_locks/exclusive_locker.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/wdclient/exclusive_locks/exclusive_locker.go b/weed/wdclient/exclusive_locks/exclusive_locker.go
index 2f033f36b..725fa307d 100644
--- a/weed/wdclient/exclusive_locks/exclusive_locker.go
+++ b/weed/wdclient/exclusive_locks/exclusive_locker.go
@@ -22,6 +22,7 @@ type ExclusiveLocker struct {
isLocking bool
masterClient *wdclient.MasterClient
lockName string
+ message string
}
func NewExclusiveLocker(masterClient *wdclient.MasterClient, lockName string) *ExclusiveLocker {
@@ -87,6 +88,7 @@ func (l *ExclusiveLocker) RequestLock(clientName string) {
PreviousLockTime: atomic.LoadInt64(&l.lockTsNs),
LockName: l.lockName,
ClientName: clientName,
+ Message: l.message,
})
if err == nil {
atomic.StoreInt64(&l.token, resp.Token)
@@ -123,3 +125,7 @@ func (l *ExclusiveLocker) ReleaseLock() {
atomic.StoreInt64(&l.token, 0)
atomic.StoreInt64(&l.lockTsNs, 0)
}
+
+func (l *ExclusiveLocker) SetMessage(message string) {
+ l.message = message
+}