Skip to content

Commit

Permalink
Remove jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Sep 17, 2024
1 parent 9811746 commit 0edec45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/modules/licence-import/jobs/import-company.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const QueueLicencesSystemJob = require('./queue-licences-system')
const QueueLicencesJob = require('./queue-licences.js')
const extract = require('../extract')
const importCompanies = require('../connectors/import-companies')
const load = require('../load')
Expand Down Expand Up @@ -81,7 +81,7 @@ async function onComplete (messageQueue) {

if (count === 0) {
await messageQueue.deleteQueue('__state__completed__licence-import.import-company')
await messageQueue.publish(QueueLicencesSystemJob.createMessage())
await messageQueue.publish(QueueLicencesJob.createMessage())

global.GlobalNotifier.omg(`${JOB_NAME}: finished`)
}
Expand Down
12 changes: 0 additions & 12 deletions src/modules/licence-import/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ const cron = require('node-cron')
const DeleteRemovedDocumentsJob = require('./jobs/delete-removed-documents.js')
const ImportCompanyJob = require('./jobs/import-company.js')
const ImportLicenceJob = require('./jobs/import-licence.js')
const ImportLicenceSystemJob = require('./jobs/import-licence-system.js')
const ImportPointsJob = require('./jobs/import-points.js')
const ImportPurposeConditionTypesJob = require('./jobs/import-purpose-condition-types.js')
const QueueCompaniesJob = require('./jobs/queue-companies.js')
const QueueLicencesJob = require('./jobs/queue-licences.js')
const QueueLicencesSystemJob = require('./jobs/queue-licences-system.js')

const config = require('../../../config')

Expand Down Expand Up @@ -39,16 +37,6 @@ async function register (server, _options) {
return ImportCompanyJob.onComplete(server.messageQueue)
})

await server.messageQueue.subscribe(QueueLicencesSystemJob.name, QueueLicencesSystemJob.handler)
await server.messageQueue.onComplete(QueueLicencesSystemJob.name, (executedJob) => {
return QueueLicencesSystemJob.onComplete(server.messageQueue, executedJob)
})

await server.messageQueue.subscribe(ImportLicenceSystemJob.name, ImportLicenceSystemJob.options, ImportLicenceSystemJob.handler)
await server.messageQueue.onComplete(ImportLicenceSystemJob.name, (executedJob) => {
return ImportLicenceSystemJob.onComplete(server.messageQueue, executedJob)
})

await server.messageQueue.subscribe(QueueLicencesJob.name, QueueLicencesJob.handler)
await server.messageQueue.onComplete(QueueLicencesJob.name, (executedJob) => {
return QueueLicencesJob.onComplete(server.messageQueue, executedJob)
Expand Down

0 comments on commit 0edec45

Please sign in to comment.