fix(delivery): use unique pending AWX job placeholders
This commit is contained in:
@@ -761,7 +761,7 @@ func (s *DeliveryService) CreateExecution(ctx context.Context, taskID, payloadHa
|
||||
}
|
||||
// Persist execution record BEFORE launching AWX to ensure crash recovery.
|
||||
now := time.Now()
|
||||
execution := model.ExecutionJob{TaskID: task.ID, IdempotencyKey: task.IdempotencyKey, ExecutorJobID: "pending", Status: "launching", StartedAt: &now}
|
||||
execution := model.ExecutionJob{TaskID: task.ID, IdempotencyKey: task.IdempotencyKey, ExecutorJobID: pendingExecutorJobID(task.ID), Status: "launching", StartedAt: &now}
|
||||
if err := s.db.WithContext(ctx).Create(&execution).Error; err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
@@ -1119,3 +1119,7 @@ func (s *DeliveryService) Run(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func pendingExecutorJobID(taskID string) string {
|
||||
return "pending:" + taskID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user