mirror of https://github.com/1Panel-dev/1Panel
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
246 B
14 lines
246 B
2 years ago
|
package service
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/1Panel-dev/1Panel/global"
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
func getTxAndContext() (tx *gorm.DB, ctx context.Context) {
|
||
|
tx = global.DB.Begin()
|
||
|
ctx = context.WithValue(context.Background(), "db", tx)
|
||
|
return
|
||
|
}
|