aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-21 20:40:59 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-21 20:40:59 +0100
commitda1926efc1e1f150f27e0c93d1461e3f1eb8c85a (patch)
treeba043a349e337113f2754642a9b78b020b547762 /app/controllers
parent7dbc313632ecebd638bd464bdc430292218d4c9e (diff)
downloadgovuk-mini-environment-admin-da1926efc1e1f150f27e0c93d1461e3f1eb8c85a.tar
govuk-mini-environment-admin-da1926efc1e1f150f27e0c93d1461e3f1eb8c85a.tar.gz
Update Que to 1.0.0 (beta 3)
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/que_jobs_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/que_jobs_controller.rb b/app/controllers/que_jobs_controller.rb
index a458e9d..36d5558 100644
--- a/app/controllers/que_jobs_controller.rb
+++ b/app/controllers/que_jobs_controller.rb
@@ -20,9 +20,7 @@
class QueJobsController < ApplicationController
def cancel
- ActiveRecord::Base.connection.execute(
- "DELETE FROM que_jobs WHERE job_id = #{job_id}::bigint"
- )
+ Que.execute :expire_job, [job_id]
flash[:success] = 'Job canceled'
@@ -32,8 +30,8 @@ class QueJobsController < ApplicationController
def retry_now
ActiveRecord::Base.connection.execute(
"UPDATE que_jobs
- SET run_at = now()
- WHERE job_id = #{job_id}::bigint"
+ SET run_at = now()
+ WHERE id = #{job_id}::bigint"
)
flash[:success] = 'Retrying the job now'