Unlock releases the lock on the cache directory
()
| 71 | |
| 72 | // Unlock releases the lock on the cache directory |
| 73 | func (p *Provider) Unlock() { |
| 74 | p.lockMut.Lock() |
| 75 | defer p.lockMut.Unlock() |
| 76 | // if the lock is not set, we do not need to do anything |
| 77 | if p.lock == nil { |
| 78 | return |
| 79 | } |
| 80 | var lockFile = filepath.Join(p.dir, lockfile) |
| 81 | if err := p.lock.Unlock(); err != nil { |
| 82 | log.Errorf("unable to close lock for cache %s: %v", lockFile, err) |
| 83 | } |
| 84 | p.lock = nil |
| 85 | } |
no test coverage detected