From 2a80e5a81eeec260840a00f09733c203f2572eea Mon Sep 17 00:00:00 2001
From: Lunny Xiao <xiaolunwen@gmail.com>
Date: Wed, 25 Jan 2017 16:19:14 +0800
Subject: [PATCH] bug fixed caused by #530 (#755)

---
 routers/init.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/routers/init.go b/routers/init.go
index 38a456639d..23bf7ae628 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -37,7 +37,6 @@ func checkRunMode() {
 func NewServices() {
 	setting.NewServices()
 	mailer.NewContext()
-	indexer.NewContext()
 }
 
 // GlobalInit is for global configuration reload-able.
@@ -61,6 +60,7 @@ func GlobalInit() {
 
 		// Booting long running goroutines.
 		cron.NewContext()
+		indexer.NewContext()
 		models.InitSyncMirrors()
 		models.InitDeliverHooks()
 		models.InitTestPullRequests()