mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-10 04:20:26 +08:00
集群可以设置systemd系统服务
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user