summary refs log tree commit diff stats
path: root/cache.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-23 00:21:53 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-23 01:08:13 -0400
commitcd635e6c6b009d6c9d6943ea7c850ca740172b65 (patch)
tree47c482560cf5f0019f6e13076fc39053f9d5bf77 /cache.go
parentd15180e9dcd540d5850fa0319a7614620075eaea (diff)
downloadgetwtxt-cd635e6c6b009d6c9d6943ea7c850ca740172b65.tar.gz
configuration init changes
Diffstat (limited to 'cache.go')
-rw-r--r--cache.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cache.go b/cache.go
index fedc29d..2ed21f3 100644
--- a/cache.go
+++ b/cache.go
@@ -13,13 +13,13 @@ import (
 // Checks whether it's time to refresh
 // the cache.
 func checkCacheTime() bool {
-	return time.Since(confObj.lastCache) > confObj.cacheInterval
+	return time.Since(confObj.LastCache) > confObj.CacheInterval
 }
 
 // Checks whether it's time to push
 // the cache to the database
 func checkDBtime() bool {
-	return time.Since(confObj.lastPush) > confObj.dbInterval
+	return time.Since(confObj.LastPush) > confObj.DBInterval
 }
 
 // Launched by init as a goroutine to constantly watch
@@ -59,9 +59,9 @@ func refreshCache() {
 			log.Printf("Error while refreshing local copy of remote registry user data: %v\n", err)
 		}
 	}
-	confObj.mu.Lock()
-	confObj.lastCache = time.Now()
-	confObj.mu.Unlock()
+	confObj.Mu.Lock()
+	confObj.LastCache = time.Now()
+	confObj.Mu.Unlock()
 }
 
 // Pushes the registry's cache data to a local
@@ -104,9 +104,9 @@ func pushDatabase() error {
 	// Update the last push time for
 	// our timer/watch function to
 	// reference.
-	confObj.mu.Lock()
-	confObj.lastPush = time.Now()
-	confObj.mu.Unlock()
+	confObj.Mu.Lock()
+	confObj.LastPush = time.Now()
+	confObj.Mu.Unlock()
 
 	return nil
 }