update to work with latest go-filecache

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 4 years ago
parent 3ffba65c76
commit be8a92edfb

@ -127,7 +127,7 @@ func AddGeneratedFile(p *Path, b []byte) {
defer FileCache.Unlock()
// Wrap contents in File
file := filecache.NewFile(p, false, &generatedFileContent{b})
file := filecache.NewFile(p.Absolute(), false, &generatedFileContent{b})
// Add to cache!
FileCache.Put(file)

@ -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!!)

@ -5,6 +5,6 @@ go 1.15
require (
github.com/grufwub/go-bufpools v0.0.0-20201026084325-a3a938b7d6d8
github.com/grufwub/go-errors v0.0.0-20201109215724-b43fef6af3e8
github.com/grufwub/go-filecache v0.0.0-20201109230405-fc17bb15911c
github.com/grufwub/go-filecache v0.0.0-20201109234016-53d503bf2622
github.com/grufwub/go-logger v0.0.0-20201101130825-423526bd353f
)

@ -6,6 +6,8 @@ github.com/grufwub/go-filecache v0.0.0-20201109171316-e186294c25c3 h1:sKi/LgWR7E
github.com/grufwub/go-filecache v0.0.0-20201109171316-e186294c25c3/go.mod h1:FAUdzHGs72ulYZCh9xPJWJosuInjppjBOw/bKJYS+R8=
github.com/grufwub/go-filecache v0.0.0-20201109230405-fc17bb15911c h1:7wPLhDm60uI8f5pU5wlkVtrAV+ej5uNZQ0BbXq85enk=
github.com/grufwub/go-filecache v0.0.0-20201109230405-fc17bb15911c/go.mod h1:FAUdzHGs72ulYZCh9xPJWJosuInjppjBOw/bKJYS+R8=
github.com/grufwub/go-filecache v0.0.0-20201109234016-53d503bf2622 h1:5KP/W4Usq09XBySqmPVuYDcPAGI4Z86bTN4k1yKapmI=
github.com/grufwub/go-filecache v0.0.0-20201109234016-53d503bf2622/go.mod h1:FAUdzHGs72ulYZCh9xPJWJosuInjppjBOw/bKJYS+R8=
github.com/grufwub/go-logger v0.0.0-20201101130825-423526bd353f h1:dLs3F/sxDeP9EOF+9oUVoCucDoPBvmRCGKQnbrTgZsg=
github.com/grufwub/go-logger v0.0.0-20201101130825-423526bd353f/go.mod h1:pZny1PMTpy9FAKMbaDYbPJbthl0wrSpVoIcnEjkRZaQ=
github.com/grufwub/go-upmutex v0.0.0-20201106234426-e4de73a0e690 h1:o2aGDpfO5v3qAVlvwLzQMM549fzMPi5NaT44YVdIprk=

Loading…
Cancel
Save