Skip to content

Commit

Permalink
Fixed missing retryJob implementation in IHP.Job.Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Jul 30, 2023
1 parent 39d49d5 commit 6c5d26b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions IHP/Job/Dashboard.hs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,19 @@ instance {-# OVERLAPPABLE #-} (DisplayableJob job, JobsDashboard rest) => JobsDa
then deleteJob @(job:rest) table (param "id")
else deleteJob' @rest False

retryJob table uuid = do
let id :: UUID = param "id"
table :: Text = param "tableName"
retryJobById table id = sqlExec ("UPDATE ? SET status = 'job_status_retry' WHERE id = ?") (PG.Identifier table, id)
retryJobById table id
setSuccessMessage (columnNameToFieldLabel table <> " record marked as 'retry'.")
redirectTo ListJobsAction
retryJob' = do
let table = param "tableName"

if tableName @job == table
then retryJob @(job:rest) table (param "id")
else retryJob' @rest

extractText = \(Only t) -> t
getNotIncludedTableNames includedNames = map extractText <$> sqlQuery
Expand Down

0 comments on commit 6c5d26b

Please sign in to comment.