Skip to content

Commit

Permalink
fix issue with locking broken (#1619)
Browse files Browse the repository at this point in the history
* fix issue with locking broken return lock result: false
  • Loading branch information
motatoes authored Jul 15, 2024
1 parent 3c3587f commit 06dac15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions libs/execution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type Executor interface {
}

type LockingExecutorWrapper struct {
Enable bool
ProjectLock locking.ProjectLock
Executor Executor
}
Expand Down Expand Up @@ -83,9 +82,6 @@ func (l LockingExecutorWrapper) Unlock() error {
}

func (l LockingExecutorWrapper) Lock() error {
if !l.Enable {
return nil
}
_, err := l.ProjectLock.Lock()
if err != nil {
return fmt.Errorf("failed to acquire lock: %s, %v", l.ProjectLock.LockId(), err)
Expand Down
2 changes: 1 addition & 1 deletion libs/locking/locking.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (projectLock *PullRequestLock) Lock() (bool, error) {
return false, nil
}

var existingLockTransactionId *int
existingLockTransactionId, err := projectLock.InternalLock.GetLock(lockId)

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

0 comments on commit 06dac15

Please sign in to comment.