Skip to content

Commit 5cf4df4

Browse files
author
Keerthan Mala
committed
fix(sshd): unlock the repository when gitreceive succeeds or fails
1 parent 5a5371c commit 5cf4df4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/sshd/lock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ func wrapInLock(lck RepositoryLock, repoName string, fn func() error) error {
3838
case <-doneCh:
3939
}
4040
}()
41+
defer lck.Unlock(repoName)
4142
select {
4243
case <-timer.C:
43-
lck.Unlock(repoName)
4444
defer close(doneCh)
4545
return fmt.Errorf("%s lock exceeded timout", repoName)
4646
case err := <-fnCh:

0 commit comments

Comments
 (0)