上传服务初始化异常检测输出
This commit is contained in:
parent
8fcd812986
commit
2bb6f4de0f
@ -13,12 +13,12 @@ type GameConfig struct {
|
||||
|
||||
//区服db配置
|
||||
type DBConfig struct {
|
||||
RedisIsCluster bool //redis 是否是集群模式
|
||||
RedisAddr string //redis 地址
|
||||
RedisPassword string //redis 密码
|
||||
RedisDB int32 //redis db
|
||||
MongodbUrl string //mgondb 地址
|
||||
MongodbDatabase string //数据库地址
|
||||
RedisIsCluster bool //redis 是否是集群模式
|
||||
RedisAddr []string //redis 地址
|
||||
RedisPassword string //redis 密码
|
||||
RedisDB int32 //redis db
|
||||
MongodbUrl string //mgondb 地址
|
||||
MongodbDatabase string //数据库地址
|
||||
}
|
||||
|
||||
//服务配置
|
||||
|
@ -49,6 +49,7 @@ type ServiceBase struct {
|
||||
|
||||
//服务初始化过程 完成 系统 和 服务组件的 初始化过程
|
||||
func (this *ServiceBase) Init(service core.IService) (err error) {
|
||||
defer lego.Recover("Service Init")
|
||||
this.closesig = make(chan string, 1)
|
||||
this.service = service
|
||||
this.modules = make(map[core.M_Modules]*defaultModule)
|
||||
@ -80,6 +81,7 @@ func (this *ServiceBase) OnInstallComp(cops ...core.IServiceComp) {
|
||||
|
||||
//启动服务 完成服务组件的启动过程
|
||||
func (this *ServiceBase) Start() (err error) {
|
||||
defer lego.Recover("Service Start")
|
||||
for _, v := range this.comps {
|
||||
err = v.Start()
|
||||
if err != nil {
|
||||
@ -93,6 +95,7 @@ func (this *ServiceBase) Start() (err error) {
|
||||
//运行模块
|
||||
func (this *ServiceBase) Run(mod ...core.IModule) {
|
||||
go func() {
|
||||
defer lego.Recover("Service Run")
|
||||
for _, v := range mod { //初始化模块对象 分配配置参数
|
||||
if sf, ok := this.service.GetSettings().Modules[string(v.GetType())]; ok {
|
||||
this.modules[v.GetType()] = &defaultModule{
|
||||
|
Loading…
Reference in New Issue
Block a user