IsFileLockedByCurrentCommitter returns whether a file is locked by the current user, as cached locally
(path string)
| 419 | // IsFileLockedByCurrentCommitter returns whether a file is locked by the |
| 420 | // current user, as cached locally |
| 421 | func (c *Client) IsFileLockedByCurrentCommitter(path string) bool { |
| 422 | filter := map[string]string{"path": path} |
| 423 | locks, err := c.searchLocalLocks(filter, 1) |
| 424 | if err != nil { |
| 425 | tracerx.Printf("Error searching cached locks: %s\nForcing remote search", err) |
| 426 | locks, _ = c.searchRemoteLocks(filter, 1) |
| 427 | } |
| 428 | return len(locks) > 0 |
| 429 | } |
| 430 | |
| 431 | func init() { |
| 432 | kv.RegisterTypeForStorage(&Lock{}) |
no test coverage detected