Skip to content

Commit 06dac15

Browse files
authored
fix issue with locking broken (#1619)
* fix issue with locking broken return lock result: false
1 parent 3c3587f commit 06dac15

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

libs/execution/execution.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ type Executor interface {
2828
}
2929

3030
type LockingExecutorWrapper struct {
31-
Enable bool
3231
ProjectLock locking.ProjectLock
3332
Executor Executor
3433
}
@@ -83,9 +82,6 @@ func (l LockingExecutorWrapper) Unlock() error {
8382
}
8483

8584
func (l LockingExecutorWrapper) Lock() error {
86-
if !l.Enable {
87-
return nil
88-
}
8985
_, err := l.ProjectLock.Lock()
9086
if err != nil {
9187
return fmt.Errorf("failed to acquire lock: %s, %v", l.ProjectLock.LockId(), err)

libs/locking/locking.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (projectLock *PullRequestLock) Lock() (bool, error) {
6161
return false, nil
6262
}
6363

64-
var existingLockTransactionId *int
64+
existingLockTransactionId, err := projectLock.InternalLock.GetLock(lockId)
6565

6666
if err != nil {
6767
log.Printf("failed to get lock: %v\n", err)

0 commit comments

Comments
 (0)