run.js 486 Bytes
const MODULE_NAME = 'PULL.RUN';
const logger = require('tektrans-logger');

const config = require('../config');
const getPrepaid = require('./get-prepaid');

/**
 * Run pulling schedule
 */
module.exports = async () => {
    logger.verbose(`${MODULE_NAME} 34022A49: Run pulling schedule`, {
        interval: config.pull_interval_ms,
    });
    setInterval(() => {
        logger.verbose(`${MODULE_NAME} 06B8C652: Pull run`);
        getPrepaid();
    }, config.pull_interval_ms);
};