Skip to content

Commit

Permalink
Add endpoint to enable manual triggering of job
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Sep 24, 2024
1 parent 2b88d69 commit 91b0c34
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/modules/points/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

const PointsJob = require('./jobs/points.js')

async function points (request, h) {
await request.messageQueue.deleteQueue(PointsJob.JOB_NAME)
await request.messageQueue.publish(PointsJob.createMessage())

return h.response().code(204)
}

module.exports = {
points
}
13 changes: 13 additions & 0 deletions src/modules/points/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict'

const controller = require('./controller')

const routes = [
{
method: 'post',
handler: controller.points,
path: '/import/points'
}
]

module.exports = routes

0 comments on commit 91b0c34

Please sign in to comment.