|
|
|
@ -255,6 +255,9 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
|
|
|
|
|
// Get file read lock
|
|
|
|
|
cached.RLock()
|
|
|
|
|
|
|
|
|
|
// Get contents from file
|
|
|
|
|
content = cached.Content().(FileContent)
|
|
|
|
|
|
|
|
|
|
// Check for file freshness
|
|
|
|
|
if !cached.IsFresh() {
|
|
|
|
|
// Try upgrade file lock, else error out (have to remember to unlock!!)
|
|
|
|
@ -263,9 +266,6 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
|
|
|
|
|
return errors.NewError(MutexUpgradeErr)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get contents from file
|
|
|
|
|
content = cached.Content().(FileContent)
|
|
|
|
|
|
|
|
|
|
// Refresh file contents
|
|
|
|
|
err := content.Load(p, file)
|
|
|
|
|
if err != nil {
|
|
|
|
|