Fix the order error of context.
This commit is contained in:
@ -195,7 +195,8 @@ func (this *Context) GetBean(bean core.IBean) core.IBean {
|
|||||||
//初始化每个Bean
|
//初始化每个Bean
|
||||||
func (this *Context) initBeans() {
|
func (this *Context) initBeans() {
|
||||||
|
|
||||||
for _, bean := range this.BeanMap {
|
for key, bean := range this.BeanMap {
|
||||||
|
core.LOGGER.Info("init %s", key)
|
||||||
bean.Init()
|
bean.Init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
main.go
4
main.go
@ -15,18 +15,18 @@ func main() {
|
|||||||
|
|
||||||
//日志第一优先级保障
|
//日志第一优先级保障
|
||||||
tankLogger := &support.TankLogger{}
|
tankLogger := &support.TankLogger{}
|
||||||
|
core.LOGGER = tankLogger
|
||||||
tankLogger.Init()
|
tankLogger.Init()
|
||||||
defer tankLogger.Destroy()
|
defer tankLogger.Destroy()
|
||||||
core.LOGGER = tankLogger
|
|
||||||
|
|
||||||
//装载配置文件,这个决定了是否需要执行安装过程
|
//装载配置文件,这个决定了是否需要执行安装过程
|
||||||
config.CONFIG.Init()
|
config.CONFIG.Init()
|
||||||
|
|
||||||
//全局运行的上下文
|
//全局运行的上下文
|
||||||
tankContext := &rest.Context{}
|
tankContext := &rest.Context{}
|
||||||
|
core.CONTEXT = tankContext
|
||||||
tankContext.Init()
|
tankContext.Init()
|
||||||
defer tankContext.Destroy()
|
defer tankContext.Destroy()
|
||||||
core.CONTEXT = tankContext
|
|
||||||
|
|
||||||
http.Handle("/", core.CONTEXT)
|
http.Handle("/", core.CONTEXT)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user