Update index add cron to testing cash in

This commit is contained in:
Nuranggi Hermawan
2022-10-03 13:06:01 +07:00
parent b1b0aad33b
commit 944d03efcc
+20
View File
@@ -109,5 +109,25 @@ if (process.env.NODE_ENV.toUpperCase() == "PRODUCTION") {
}
});
}
// cash in
const {
_generateCashIn,
} = require("../application/modules/cashin/cahsin.controller");
cron.schedule('* * * * *', async () => {
try {
let uniqueCode = helper.getUniqueCode();
winston.logger.info(`STARTING SCHEDULER-FB70 GENERATE CASH IN ${uniqueCode}`);
const posting = await _generateCashIn(uniqueCode);
winston.logger.info(
`END SCHEDULER-FB70 GENERATE CASH IN : ${JSON.stringify(posting)}`
);
} catch (error) {
// create log
winston.logger.error(
`500 internal server error - backend server | ${error.message}`
);
}
});
module.exports = app;