diff options
author | Lauris BH <lauris@nix.lv> | 2017-10-26 04:37:33 +0300 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-10-26 09:37:33 +0800 |
commit | eca05b09aa269dda1309ee77ac750e29e71c3fd3 (patch) | |
tree | 8f5a4aa5c7da0de3e6c2a16f8a567b0b1b0c758b /routers/routes | |
parent | 3ab580c8d6b8a2c063d848f8e3002347c9e5cebb (diff) | |
download | gitea-eca05b09aa269dda1309ee77ac750e29e71c3fd3.tar.gz gitea-eca05b09aa269dda1309ee77ac750e29e71c3fd3.zip |
Add commit count caching (#2774)
* Add commit count caching
* Small refactoring
* Add different key prefix for refs and commits
* Add configuratuion option to allow to change caching time or disable it
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 227b4fff9c..703afbb4a7 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -99,9 +99,9 @@ func NewMacaron() *macaron.Macaron { Redirect: true, })) m.Use(cache.Cacher(cache.Options{ - Adapter: setting.CacheAdapter, - AdapterConfig: setting.CacheConn, - Interval: setting.CacheInterval, + Adapter: setting.CacheService.Adapter, + AdapterConfig: setting.CacheService.Conn, + Interval: setting.CacheService.Interval, })) m.Use(captcha.Captchaer(captcha.Options{ SubURL: setting.AppSubURL, @@ -576,9 +576,9 @@ func RegisterRoutes(m *macaron.Macaron) { ctx.Handle(500, "GetBranchCommit", err) return } - ctx.Repo.CommitsCount, err = ctx.Repo.Commit.CommitsCount() + ctx.Repo.CommitsCount, err = ctx.Repo.GetCommitsCount() if err != nil { - ctx.Handle(500, "CommitsCount", err) + ctx.Handle(500, "GetCommitsCount", err) return } ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount |