diff options
Diffstat (limited to 'cache.go')
-rw-r--r-- | cache.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cache.go b/cache.go index 2db0fbb..882c4d8 100644 --- a/cache.go +++ b/cache.go @@ -67,12 +67,16 @@ func refreshCache() { // pulled back into memory from disk. func pingAssets() { - cssStat, err := os.Stat("assets/style.css") + confObj.Mu.RLock() + assetsDir := confObj.AssetsDir + confObj.Mu.RUnlock() + + cssStat, err := os.Stat(assetsDir + "/style.css") if err != nil { log.Printf("%v\n", err.Error()) } - indexStat, err := os.Stat("assets/tmpl/index.html") + indexStat, err := os.Stat(assetsDir + "/tmpl/index.html") if err != nil { log.Printf("%v\n", err.Error()) } @@ -99,7 +103,7 @@ func pingAssets() { if !cssMod.Equal(cssStat.ModTime()) { - css, err := ioutil.ReadFile("assets/style.css") + css, err := ioutil.ReadFile(assetsDir + "/style.css") if err != nil { log.Printf("%v\n", err.Error()) } |