61 lines
1.1 KiB
Go
61 lines
1.1 KiB
Go
package mergegroup
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/lego/core/cbase"
|
|
"go_dreamfactory/lego/sys/cron"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/sys/db"
|
|
)
|
|
|
|
/*
|
|
模块名称:动态合服模块
|
|
运行服务:mainte
|
|
运行区服:跨服环境下运行
|
|
开发:李伟
|
|
*/
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(MergeGroup)
|
|
return m
|
|
}
|
|
|
|
type MergeGroup struct {
|
|
cbase.ModuleBase
|
|
}
|
|
|
|
func (this *MergeGroup) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
if err = this.ModuleBase.Init(service, module, options); err != nil {
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
func (this *MergeGroup) GetType() core.M_Modules {
|
|
return comm.ModuleMergeGroup
|
|
}
|
|
|
|
func (this *MergeGroup) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
|
|
}
|
|
|
|
func (this *MergeGroup) Start() (err error) {
|
|
if err = this.ModuleBase.Start(); err != nil {
|
|
return
|
|
}
|
|
if db.IsCross() {
|
|
if _, err = cron.AddFunc("0 59 23 ? * SAT", this.CheckMerge); err != nil {
|
|
log.Errorln(err)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
//检查合并
|
|
func (this *MergeGroup) CheckMerge() {
|
|
|
|
}
|