Skip to content

Commit 4e61f88

Browse files
committed
actually, the defer will be executed even if the function panics
1 parent defa5a3 commit 4e61f88

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

manager/entraid_manager.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ func (e *entraidTokenManager) stop() (err error) {
220220
defer func() {
221221
// recover from panic and return the error
222222
if r := recover(); r != nil {
223-
// make sure the lock is released
224-
e.lock.TryLock()
225-
e.lock.Unlock()
226223
err = fmt.Errorf("failed to stop token manager: %s", r)
227224
}
228225
}()

0 commit comments

Comments
 (0)