集群可以设置systemd系统服务

This commit is contained in:
GoEdgeLab
2021-01-11 18:16:04 +08:00
parent af5584c768
commit fe652e6979
8 changed files with 186 additions and 5 deletions

View File

@@ -91,3 +91,12 @@ func (this *BaseService) PermissionError() error {
func (this *BaseService) NullTx() *dbs.Tx {
return nil
}
// 获取当前的数据库
func (this *BaseService) RunTx(callback func(tx *dbs.Tx) error) error {
db, err := dbs.Default()
if err != nil {
return err
}
return db.RunTx(callback)
}