feat(platform): 模型管理与后台能力 - 新增逻辑模型路由和响应拦截
This commit is contained in:
1 parent
0002cdd2cb
commit
8c5f56a551
89 files changed
+21451
-1170
No files matched your search
@@ -211,8 +211,9 @@ func (r *Repository) CreateTaskWithActiveLimit(task *model.Task, activeTaskLimit
|
||||
})
|
||||
}
|
||||
|
||||
func (r *Repository) RetryTaskWithBilling(userID string, taskID string, order *model.BillingOrder, activeTaskLimit int) (*model.Task, error) {
|
||||
func (r *Repository) RetryTaskWithBilling(userID string, prepared *model.Task, order *model.BillingOrder, activeTaskLimit int) (*model.Task, error) {
|
||||
var task model.Task
|
||||
taskID := prepared.ID
|
||||
err := r.db.Transaction(func(tx *gorm.DB) error {
|
||||
if err := enforceActiveTaskLimit(tx, userID, activeTaskLimit); err != nil {
|
||||
return err
|
||||
@@ -228,6 +229,10 @@ func (r *Repository) RetryTaskWithBilling(userID string, taskID string, order *m
|
||||
"provider_request_id": "", "poll_stage": "", "next_poll_at": nil,
|
||||
"provider_cancel_status": "", "provider_cancel_error": "", "provider_cancel_attempts": 0,
|
||||
"provider_cancel_requested_at": nil, "provider_cancelled_at": nil, "provider_cancel_next_check_at": nil,
|
||||
"route_run": gorm.Expr("route_run + ?", 1),
|
||||
"logical_model_revision_id": prepared.LogicalModelRevisionID, "route_id": prepared.RouteID,
|
||||
"physical_variant_id": prepared.PhysicalVariantID, "input_json": prepared.InputJSON,
|
||||
"model": prepared.Model, "provider": prepared.Provider,
|
||||
"lease_owner": "", "lease_expires_at": nil, "updated_at": time.Now(),
|
||||
}
|
||||
if order != nil {
|
||||
|
||||
Reference in new issue
Block a user