UNPKG

@defra-fish/recurring-payments-job

Version:

Rod Licensing Recurring Payments Job

19 lines (15 loc) 488 B
'use strict' import recurringPaymentsJob from 'commander' import { processRecurringPayments } from './recurring-payments-processor.js' const delay = parseInt(process.env.RECURRING_PAYMENTS_LOCAL_DELAY || '0', 10) if (delay > 0) { setTimeout(() => { executeRecurringPaymentsJob() }, delay * 1000) } else { executeRecurringPaymentsJob() } function executeRecurringPaymentsJob () { recurringPaymentsJob.action(processRecurringPayments()) } export default recurringPaymentsJob