mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 04:40:05 +01:00
@@ -211,12 +211,18 @@ func RunClusterAction(db *gorm.DB, jobs *bg.Jobs) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args := bg.ClusterActionArgs{
|
||||||
|
OrgID: orgID,
|
||||||
|
ClusterID: clusterID,
|
||||||
|
Action: action.MakeTarget,
|
||||||
|
MakeTarget: action.MakeTarget,
|
||||||
|
}
|
||||||
// Enqueue with run.ID as the job ID so the worker can look it up.
|
// Enqueue with run.ID as the job ID so the worker can look it up.
|
||||||
_, enqueueErr := jobs.Enqueue(
|
_, enqueueErr := jobs.Enqueue(
|
||||||
r.Context(),
|
r.Context(),
|
||||||
run.ID.String(),
|
run.ID.String(),
|
||||||
"cluster_action",
|
"cluster_action",
|
||||||
bg.ClusterActionWorker,
|
args,
|
||||||
archer.WithMaxRetries(3),
|
archer.WithMaxRetries(3),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -225,7 +231,7 @@ func RunClusterAction(db *gorm.DB, jobs *bg.Jobs) http.HandlerFunc {
|
|||||||
Where("id = ?", run.ID).
|
Where("id = ?", run.ID).
|
||||||
Updates(map[string]any{
|
Updates(map[string]any{
|
||||||
"status": models.ClusterRunStatusFailed,
|
"status": models.ClusterRunStatusFailed,
|
||||||
"error": "failed to enqueue job",
|
"error": "failed to enqueue job: " + enqueueErr.Error(),
|
||||||
"finished_at": time.Now().UTC(),
|
"finished_at": time.Now().UTC(),
|
||||||
}).Error
|
}).Error
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user