From de01f814892666298d24f79f769a7c0766119c87 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 21 Apr 2014 06:54:07 -0400 Subject: [PATCH] Prepare for v0.3.0 release --- models/models.go | 1 - modules/base/base_memcache.go | 11 +++++++++++ modules/base/base_redis.go | 11 +++++++++++ modules/base/conf.go | 7 +++++-- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 modules/base/base_memcache.go create mode 100644 modules/base/base_redis.go diff --git a/models/models.go b/models/models.go index 216084f1b..8e8835ab5 100644 --- a/models/models.go +++ b/models/models.go @@ -12,7 +12,6 @@ import ( _ "github.com/go-sql-driver/mysql" "github.com/go-xorm/xorm" - _ "github.com/gogits/cache" _ "github.com/lib/pq" "github.com/gogits/gogs/modules/base" diff --git a/modules/base/base_memcache.go b/modules/base/base_memcache.go new file mode 100644 index 000000000..93ca93a4c --- /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 000000000..327af8415 --- /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 720b86108..48ba46583 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") }