From de01f814892666298d24f79f769a7c0766119c87 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 21 Apr 2014 06:54:07 -0400 Subject: Prepare for v0.3.0 release --- modules/base/base_memcache.go | 11 +++++++++++ modules/base/base_redis.go | 11 +++++++++++ modules/base/conf.go | 7 +++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 modules/base/base_memcache.go create mode 100644 modules/base/base_redis.go (limited to 'modules') diff --git a/modules/base/base_memcache.go b/modules/base/base_memcache.go new file mode 100644 index 0000000000..93ca93a4c7 --- /dev/null +++ b/modules/base/base_memcache.go @@ -0,0 +1,11 @@ +// +build memcache + +package base + +import ( + _ "github.com/gogits/cache/memcache" +) + +func init() { + EnableMemcache = true +} diff --git a/modules/base/base_redis.go b/modules/base/base_redis.go new file mode 100644 index 0000000000..327af8415b --- /dev/null +++ b/modules/base/base_redis.go @@ -0,0 +1,11 @@ +// +build redis + +package base + +import ( + _ "github.com/gogits/cache/redis" +) + +func init() { + EnableRedis = true +} diff --git a/modules/base/conf.go b/modules/base/conf.go index 720b861084..48ba46583a 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -77,6 +77,9 @@ var ( SessionManager *session.Manager PictureService string + + EnableRedis bool + EnableMemcache bool ) var Service struct { @@ -174,10 +177,10 @@ func newLogService() { func newCacheService() { CacheAdapter = Cfg.MustValue("cache", "ADAPTER", "memory") - if cache.EnableRedis { + if EnableRedis { log.Info("Redis Enabled") } - if cache.EnableMemcache { + if EnableMemcache { log.Info("Memcache Enabled") } -- cgit v1.2.3