|
|
|
@ -157,7 +157,7 @@ func HandleClient(client *Client, request *Request, newFileContents func(*Path)
|
|
|
|
|
defer FileCache.RUnlock()
|
|
|
|
|
|
|
|
|
|
// Don't throw in the towel yet! Check for generated file in cache
|
|
|
|
|
cached, ok := FileCache.Get(request.Path())
|
|
|
|
|
cached, ok := FileCache.Get(request.Path().Absolute())
|
|
|
|
|
if !ok {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
@ -217,7 +217,7 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
|
|
|
|
|
var content FileContent
|
|
|
|
|
|
|
|
|
|
// Now check for file in cache
|
|
|
|
|
cached, ok := FileCache.Get(p)
|
|
|
|
|
cached, ok := FileCache.Get(p.Absolute())
|
|
|
|
|
if !ok {
|
|
|
|
|
// Create new file contents with supplied function
|
|
|
|
|
content = newFileContent(p)
|
|
|
|
@ -231,7 +231,7 @@ func FetchFile(client *Client, file *os.File, stat os.FileInfo, p *Path, newFile
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Wrap contents in file, set fresh
|
|
|
|
|
cached = filecache.NewFile(p, true, content)
|
|
|
|
|
cached = filecache.NewFile(p.Absolute(), true, content)
|
|
|
|
|
cached.UpdateLastRefresh()
|
|
|
|
|
|
|
|
|
|
// Try upgrade our lock, else error out (have to remember to unlock!!)
|
|
|
|
|