From d335310fe37075c06c25f7aa60a8f53cb0ed5a2b Mon Sep 17 00:00:00 2001 From: Nuranggi Hermawan Date: Tue, 1 Nov 2022 19:16:41 +0700 Subject: [PATCH] comment all scheduller --- server/index.js | 86 ++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/server/index.js b/server/index.js index b4db8f6..2043d61 100644 --- a/server/index.js +++ b/server/index.js @@ -60,59 +60,59 @@ app.use("/api/", cashinRoute); if (process.env.NODE_ENV.toUpperCase() == "PRODUCTION") { // SCHEDULER FOR GENERATE INVOICE - const { - _generateInvoice, - _postingInvoice, - } = require("../application/modules/invoiceonline/invoice.controller"); + // const { + // _generateInvoice, + // _postingInvoice, + // } = require("../application/modules/invoiceonline/invoice.controller"); // every 10 minutes // cron.schedule('*/10 * * * *', async () => { // every at 01:00 - cron.schedule("0 1 * * *", async () => { - try { - // let ivoiceDate = moment().add(1, 'days').format("YYYY-MM-DD"); - let ivoiceDate = moment().format("YYYY-MM-DD"); - let uniqueCode = helper.getUniqueCode(); - winston.logger.debug( - `STARTING SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} ` - ); - const generate = await _generateInvoice(ivoiceDate, uniqueCode, false); - winston.logger.debug( - `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("0 1 * * *", async () => { + // try { + // // let ivoiceDate = moment().add(1, 'days').format("YYYY-MM-DD"); + // let ivoiceDate = moment().format("YYYY-MM-DD"); + // let uniqueCode = helper.getUniqueCode(); + // winston.logger.debug( + // `STARTING SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} ` + // ); + // const generate = await _generateInvoice(ivoiceDate, uniqueCode, false); + // winston.logger.debug( + // `END SCHEDULER-FB70 GENERATE INVOICE ${ivoiceDate} : ${JSON.stringify( + // generate + // )}` + // ); + // } catch (error) { + // // create log + // winston.logger.error( + // `500 internal server error - backend server | ${error.message}` + // ); + // } + // }); // every 15 minutes // cron.schedule('*/15 * * * *', async () => { // every 2 hour - cron.schedule("0 */2 * * *", async () => { - try { - let uniqueCode = helper.getUniqueCode(); - winston.logger.debug(`STARTING SCHEDULER-FB70 POSTING INVOICE`); - const posting = await _postingInvoice(uniqueCode); - winston.logger.debug( - `END SCHEDULER-FB70 POSTING INVOICE : ${JSON.stringify(posting)}` - ); - } catch (error) { - // create log - winston.logger.error( - `500 internal server error - backend server | ${error.message}` - ); - } - }); + // cron.schedule("0 */2 * * *", async () => { + // try { + // let uniqueCode = helper.getUniqueCode(); + // winston.logger.debug(`STARTING SCHEDULER-FB70 POSTING INVOICE`); + // const posting = await _postingInvoice(uniqueCode); + // winston.logger.debug( + // `END SCHEDULER-FB70 POSTING INVOICE : ${JSON.stringify(posting)}` + // ); + // } catch (error) { + // // create log + // winston.logger.error( + // `500 internal server error - backend server | ${error.message}` + // ); + // } + // }); } // cash in - const { - _generateCashIn, - } = require("../application/modules/cashin/cahsin.controller"); + // const { + // _generateCashIn, + // } = require("../application/modules/cashin/cahsin.controller"); // cron.schedule('* * * * *', async () => { // try {