diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-06-06 18:26:16 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-06-08 02:29:28 -0400 |
commit | 78f4d8a6c1f8c41543dd5c1522ec1100a52a1283 (patch) | |
tree | e5db1bcf37e647aa8caec5902b32c6f9ea9dbff1 /svc/cache.go | |
parent | 3eb5a0321ea6e70a7ad3234efc9a0c1263833389 (diff) | |
download | getwtxt-78f4d8a6c1f8c41543dd5c1522ec1100a52a1283.tar.gz |
sqlite functionality added
Diffstat (limited to 'svc/cache.go')
-rw-r--r-- | svc/cache.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/svc/cache.go b/svc/cache.go index 04ed2cd..0963892 100644 --- a/svc/cache.go +++ b/svc/cache.go @@ -40,8 +40,7 @@ func cacheAndPush() { refreshCache() } if dbTimer() { - err := pushDB() - errLog("Error pushing cache to database: ", err) + errLog("Error pushing cache to database: ", pushDB()) } time.Sleep(1000 * time.Millisecond) } @@ -57,16 +56,14 @@ func refreshCache() { twtxtCache.Mu.RLock() for k := range twtxtCache.Users { twtxtCache.Mu.RUnlock() - err := twtxtCache.UpdateUser(k) - errLog("", err) + errLog("", twtxtCache.UpdateUser(k)) twtxtCache.Mu.RLock() } twtxtCache.Mu.RUnlock() remoteRegistries.Mu.RLock() for _, v := range remoteRegistries.List { - err := twtxtCache.CrawlRemoteRegistry(v) - errLog("Error refreshing local copy of remote registry data: ", err) + errLog("Error refreshing local copy of remote registry data: ", twtxtCache.CrawlRemoteRegistry(v)) } remoteRegistries.Mu.RUnlock() confObj.Mu.Lock() @@ -101,9 +98,8 @@ func pingAssets() { buf := bytes.NewBuffer(b) confObj.Mu.RLock() - err = tmpls.ExecuteTemplate(buf, "index.html", confObj.Instance) + errLog("", tmpls.ExecuteTemplate(buf, "index.html", confObj.Instance)) confObj.Mu.RUnlock() - errLog("", err) staticCache.mu.Lock() staticCache.index = buf.Bytes() |