@@ -36,7 +36,7 @@ type Lock interface {
3636type ProjectLock interface {
3737 Lock (lockId string , prNumber int ) (bool , error )
3838 Unlock (lockId string , prNumber int ) (bool , error )
39- ForceUnlock (lockId string , prNumber int )
39+ ForceUnlock (lockId string , prNumber int ) error
4040}
4141
4242func (projectLock * ProjectLockImpl ) Lock (lockId string , prNumber int ) (bool , error ) {
@@ -104,18 +104,26 @@ func (projectLock *ProjectLockImpl) Unlock(lockId string, prNumber int) (bool, e
104104 return false , nil
105105}
106106
107- func (projectLock * ProjectLockImpl ) ForceUnlock (lockId string , prNumber int ) {
107+ func (projectLock * ProjectLockImpl ) ForceUnlock (lockId string , prNumber int ) error {
108108 fmt .Printf ("ForceUnlock %s\n " , lockId )
109- lock , _ := projectLock .InternalLock .GetLock (lockId )
109+ lock , err := projectLock .InternalLock .GetLock (lockId )
110+ if err != nil {
111+ return err
112+ }
110113 if lock != nil {
111- lockReleased , _ := projectLock .InternalLock .Unlock (lockId )
114+ lockReleased , err := projectLock .InternalLock .Unlock (lockId )
115+ if err != nil {
116+ return err
117+ }
112118
113119 if lockReleased {
114120 comment := "Project unlocked (" + projectLock .projectId () + ")."
115121 projectLock .PrManager .PublishComment (prNumber , comment )
116122 println ("Project unlocked" )
117123 }
124+ return nil
118125 }
126+ return nil
119127}
120128
121129func (projectLock * ProjectLockImpl ) projectId () string {
0 commit comments