mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
Update
This commit is contained in:
@@ -63,16 +63,29 @@ const ivoiceDate = moment().add(1, 'days').format("YYYY-MM-DD");
|
||||
// SCHEDULER FOR GENERATE INVOICE
|
||||
const {_generateInvoice, _postingInvoice } = require("./application/modules/invoice/invoice.controller");
|
||||
cron.schedule('*/1 * * * *', async () => {
|
||||
let uniqueCode = helper.getUniqueCode()
|
||||
// const ivoiceDate = moment().format("YYYY-MM-DD")
|
||||
winston.logger.info(`STARTING SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} `);
|
||||
const generate = await _generateInvoice(ivoiceDate, uniqueCode)
|
||||
winston.logger.info(`END SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} : ${JSON.stringify(generate)}`);
|
||||
try {
|
||||
let uniqueCode = helper.getUniqueCode()
|
||||
winston.logger.info(`STARTING SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} `);
|
||||
const generate = await _generateInvoice(ivoiceDate, uniqueCode)
|
||||
winston.logger.info(`END SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} : ${JSON.stringify(generate)}`);
|
||||
} catch (error) {
|
||||
// create log
|
||||
winston.logger.error(
|
||||
`500 internal server error - backend server | ${error.message}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
cron.schedule('*/2 * * * *', async () => {
|
||||
let uniqueCode = helper.getUniqueCode()
|
||||
winston.logger.info(`STARTING SCHEDULER-FB70 POSTING INVOICE`);
|
||||
const posting = await _postingInvoice(uniqueCode)
|
||||
winston.logger.info(`END SCHEDULER-FB70 POSTING INVOICE : ${JSON.stringify(posting)}`);
|
||||
try {
|
||||
let uniqueCode = helper.getUniqueCode()
|
||||
winston.logger.info(`STARTING SCHEDULER-FB70 POSTING INVOICE`);
|
||||
const posting = await _postingInvoice(uniqueCode)
|
||||
winston.logger.info(`END SCHEDULER-FB70 POSTING INVOICE : ${JSON.stringify(posting)}`);
|
||||
} catch (error) {
|
||||
// create log
|
||||
winston.logger.error(
|
||||
`500 internal server error - backend server | ${error.message}`
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user