Remove a cached lock by path because it's been relinquished
(filePath string)
| 37 | |
| 38 | // Remove a cached lock by path because it's been relinquished |
| 39 | func (c *LockCache) RemoveByPath(filePath string) error { |
| 40 | ilock := c.kv.Get(filePath) |
| 41 | if lock, ok := ilock.(*Lock); ok && lock != nil { |
| 42 | c.kv.Remove(lock.Path) |
| 43 | // Id as key is encoded |
| 44 | c.kv.Remove(c.encodeIdKey(lock.Id)) |
| 45 | } |
| 46 | return nil |
| 47 | } |
| 48 | |
| 49 | // Remove a cached lock by id because it's been relinquished |
| 50 | func (c *LockCache) RemoveById(id string) error { |