Skip to content

Commit

Permalink
Stop scheduling charging data
Browse files Browse the repository at this point in the history
What remains in the charging data job is just populating fixed reference data. There is no need to do this as this information never changes.

We leave the job just in case we need to trigger it. But we stop updating these tables on a nightly basis for no reason.
  • Loading branch information
Cruikshanks committed Sep 2, 2024
1 parent e34940a commit c7ff862
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ WRLS_LOG_LEVEL=debug

# Use Cron type syntax to set timings for these background processes
WRLS_CRON_LICENCES='0 16 * * 1,2,3,4,5'
WRLS_CRON_CHARGING='0 14 * * 1,2,3,4,5'
WRLS_CRON_NALD='0 */1 * * *'
WRLS_CRON_MOD_LOGS='0 7 * * 1,2,3,4,5'
WRLS_CRON_RETURN_VERSIONS='0 6 * * 1,2,3,4,5'
Expand Down
3 changes: 0 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ module.exports = {
// was calculated from NALD data
isBillingDocumentRoleImportEnabled: false
},
charging: {
schedule: process.env.WRLS_CRON_CHARGING || '0 1 * * 1,2,3,4,5'
},
modLogs: {
schedule: process.env.WRLS_CRON_MOD_LOGS || '0 7 * * 1,2,3,4,5'
},
Expand Down
9 changes: 0 additions & 9 deletions src/modules/charging-import/plugin.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
'use strict'

const cron = require('node-cron')

const chargeVersionsJob = require('./jobs/charge-versions')
const chargingDataJob = require('./jobs/charging-data')

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

const registerSubscribers = async server => {
// Register handlers
await server.messageQueue.subscribe(chargeVersionsJob.jobName, chargeVersionsJob.handler)
await server.messageQueue.subscribe(chargingDataJob.jobName, chargingDataJob.handler)

// Set up import of charge data on cron job
cron.schedule(config.import.charging.schedule,
() => server.messageQueue.publish(chargingDataJob.createMessage())
)
}

const plugin = {
Expand Down

0 comments on commit c7ff862

Please sign in to comment.