This commit is contained in:
Alex Yatskov 2021-04-25 08:57:24 -07:00
parent 14c434a6a4
commit 3155de7542
2 changed files with 8 additions and 8 deletions

View File

@ -67,8 +67,8 @@ func (context *Context) DispatchFile(file *File) {
// dependencies on any input files that are needed to generate it, and then // dependencies on any input files that are needed to generate it, and then
// passes it to the next link in the chain. // passes it to the next link in the chain.
func (context *Context) DispatchAndCacheFile(outputFile *File, inputFiles ...*File) { func (context *Context) DispatchAndCacheFile(outputFile *File, inputFiles ...*File) {
if context.goldsmith.fileCache != nil { if context.goldsmith.cache != nil {
context.goldsmith.fileCache.storeFile(context, outputFile, inputFiles) context.goldsmith.cache.storeFile(context, outputFile, inputFiles)
} }
context.filesOut <- outputFile context.filesOut <- outputFile
@ -79,8 +79,8 @@ func (context *Context) DispatchAndCacheFile(outputFile *File, inputFiles ...*Fi
// will return nil if the desired file is not found in the cache. // will return nil if the desired file is not found in the cache.
func (context *Context) RetrieveCachedFile(outputPath string, inputFiles ...*File) *File { func (context *Context) RetrieveCachedFile(outputPath string, inputFiles ...*File) *File {
var outputFile *File var outputFile *File
if context.goldsmith.fileCache != nil { if context.goldsmith.cache != nil {
outputFile, _ = context.goldsmith.fileCache.retrieveFile(context, outputPath, inputFiles) outputFile, _ = context.goldsmith.cache.retrieveFile(context, outputPath, inputFiles)
} }
return outputFile return outputFile

View File

@ -16,9 +16,9 @@ type Goldsmith struct {
contexts []*Context contexts []*Context
contextHasher hash.Hash32 contextHasher hash.Hash32
fileCache *cache cache *cache
filters filterStack filters filterStack
clean bool clean bool
errors []error errors []error
mutex sync.Mutex mutex sync.Mutex
@ -37,7 +37,7 @@ func Begin(sourceDir string) *Goldsmith {
// Cache enables caching in cacheDir for the remainder of the chain. // Cache enables caching in cacheDir for the remainder of the chain.
func (goldsmith *Goldsmith) Cache(cacheDir string) *Goldsmith { func (goldsmith *Goldsmith) Cache(cacheDir string) *Goldsmith {
goldsmith.fileCache = &cache{cacheDir} goldsmith.cache = &cache{cacheDir}
return goldsmith return goldsmith
} }