summaryrefslogtreecommitdiff
path: root/system/db
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-13 11:58:39 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-13 11:58:39 -0800
commit59ee9fbb237673c2d0cccad42f7adbae65852b8d (patch)
tree3326e7c43eef2483fff5e24b7e2f840fb94b4d38 /system/db
parent3249b82b2a4f1aa0ae9e6943cd72dd7eebae8a4a (diff)
changing ConfigCache to return interface{}
Diffstat (limited to 'system/db')
-rw-r--r--system/db/cache.go2
-rw-r--r--system/db/config.go2
-rw-r--r--system/db/init.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/system/db/cache.go b/system/db/cache.go
index 30ecf5a..0120147 100644
--- a/system/db/cache.go
+++ b/system/db/cache.go
@@ -11,7 +11,7 @@ import (
// CacheControl sets the default cache policy on static asset responses
func CacheControl(next http.Handler) http.HandlerFunc {
return http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
- etag := ConfigCache("etag")
+ etag := ConfigCache("etag").(string)
policy := fmt.Sprintf("max-age=%d, public", 60*60*24*30)
res.Header().Add("ETag", etag)
res.Header().Add("Cache-Control", policy)
diff --git a/system/db/config.go b/system/db/config.go
index 45b3952..f1d1215 100644
--- a/system/db/config.go
+++ b/system/db/config.go
@@ -166,6 +166,6 @@ func PutConfig(key string, value interface{}) error {
// ConfigCache is a in-memory cache of the Configs for quicker lookups
// 'key' is the JSON tag associated with the config field
-func ConfigCache(key string) string {
+func ConfigCache(key string) interface{} {
return configCache.Get(key)
}
diff --git a/system/db/init.go b/system/db/init.go
index eaf6d76..98ba056 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -71,7 +71,7 @@ func Init() {
}
}
- clientSecret := ConfigCache("client_secret")
+ clientSecret := ConfigCache("client_secret").(string)
if clientSecret != "" {
jwt.Secret([]byte(clientSecret))