/**
* ====================================================
* Check and send push of delayed campaigns of all apps
* ====================================================
*
* 1. Use getAllAppsIds function for get all active app ids. This will return app ids in callback function.
* 2. Use updateCampaigns for check expired campaign and update campaign status and remove from cache as well.
*
* @Author Manish Yadav
* @copyrights All right reserved by appice.io.
**/
var delayedCampaigns = {},
logger = require('../../../logger'),
    campaignCommon = require('./../../utils/campaign.common.js');

(function (delayedCampaigns) {
    // check campaigns
    delayedCampaigns.checkCampaigns = function(){
       setInterval(function(){
        logger.info(`check campaign`);
            campaignCommon.delayedCampaignWatcher()
       }, 1000)
    }
}(delayedCampaigns));

delayedCampaigns.checkCampaigns();
