This commit is contained in:
ziming 2025-03-26 15:06:19 +08:00
parent 3ccef3d345
commit edee30f156
2 changed files with 3 additions and 3 deletions

View File

@ -15,6 +15,6 @@ func NewDb(db *GormDb) *Db {
} }
} }
func (d *Db) DB(ctx context.Context) *gorm.DB { func (d *Db) DB(_ context.Context) *gorm.DB {
return d.db.Client.WithContext(ctx) return d.db.Client
} }

View File

@ -49,7 +49,7 @@ func (c *CmbService) OrderFail(ctx context.Context, err error) (*v1.CmbReply, er
func (c *CmbService) Order(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) { func (c *CmbService) Order(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
ctx2, cancel := context.WithCancel(ctx) ctx2, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel() defer cancel()
orderNo, err := c.order(ctx2, request) orderNo, err := c.order(ctx2, request)