Unlock releases a previously acquired lock. We achieve this by closing the previously opened db. FileUnlock can be called multiple times.
()
| 233 | // Unlock releases a previously acquired lock. We achieve this by closing |
| 234 | // the previously opened db. FileUnlock can be called multiple times. |
| 235 | func (f *FileLock) Unlock() { |
| 236 | if f.db == nil { |
| 237 | return |
| 238 | } |
| 239 | if err := f.db.Close(); err != nil { |
| 240 | logger.Warningf("unable to release the lock on file %s: %s", f.filePath, err) |
| 241 | return |
| 242 | } |
| 243 | f.db = nil |
| 244 | } |