Skip to content

Commit

Permalink
delete log
Browse files Browse the repository at this point in the history
  • Loading branch information
hekangning committed May 12, 2022
1 parent a8551d3 commit 3a07f85
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package godisson

import (
"context"
"fmt"
"github.com/pkg/errors"
"net"
"time"
Expand Down Expand Up @@ -41,7 +40,6 @@ func (m *Mutex) TryLock(waitTime int64, leaseTime int64) error {
timeoutCtx, timeoutCancel := context.WithTimeout(context.TODO(), time.Duration(wait)*time.Millisecond)
defer timeoutCancel()
_, err = sub.ReceiveMessage(timeoutCtx)
fmt.Println("receive", 1)
if err != nil {
return ErrLockNotObtained
}
Expand Down Expand Up @@ -72,7 +70,6 @@ func (m *Mutex) TryLock(waitTime int64, leaseTime int64) error {
continue
}
}
fmt.Println("receive", 2)
} else {
tCtx, _ := context.WithTimeout(context.TODO(), time.Duration(wait)*time.Millisecond)
_, err := sub.ReceiveMessage(tCtx)
Expand All @@ -82,7 +79,6 @@ func (m *Mutex) TryLock(waitTime int64, leaseTime int64) error {
continue
}
}
fmt.Println("receive", 3)
}
wait -= currentTimeMillis() - currentTime
if wait <= 0 {
Expand Down

0 comments on commit 3a07f85

Please sign in to comment.