Built motion from commit a679711e.|2.6.15
[motion2.git] / server / config / schedule / index.js
index b96166c..9eaf5e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff4=['MailServerOut','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','isBetween','startAt','endAt','add','start','add\x20cron','active','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','basename','extname','zip','join','existsSync','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5ff4,0x135));var _0x45ff=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5ff4[_0x4fde08];return _0x12e725;};'use strict';var fs=require('fs');var util=require(_0x45ff('0x0'));var path=require(_0x45ff('0x1'));var _=require(_0x45ff('0x2'));var moment=require(_0x45ff('0x3'));var CronJobManager=require(_0x45ff('0x4'));var jayson=require(_0x45ff('0x5'));var BPromise=require('bluebird');var logger=require(_0x45ff('0x6'))(_0x45ff('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x45ff('0x8'));var analyticDefaultReportController=require(_0x45ff('0x9'));var client=jayson[_0x45ff('0xa')][_0x45ff('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x549a86,_0x3e2b31){return function(){logger[_0x45ff('0xc')](_0x45ff('0xd'),_0x549a86[_0x45ff('0xe')]);var _0x3abf1a=!![];var _0x1b2f42={'tls':{'rejectUnauthorized':![]}};if(_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')][_0x45ff('0x11')]){_0x1b2f42['service']=_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')][_0x45ff('0x11')];}else{_0x1b2f42[_0x45ff('0x12')]=_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')]['host'];_0x1b2f42['port']=_0x549a86[_0x45ff('0xf')]['Smtp'][_0x45ff('0x13')];_0x1b2f42[_0x45ff('0x14')]=_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')][_0x45ff('0x14')];}if(_0x549a86[_0x45ff('0xf')]['Smtp'][_0x45ff('0x15')]){_0x1b2f42[_0x45ff('0x16')]={'user':_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')][_0x45ff('0x17')],'pass':_0x549a86[_0x45ff('0xf')][_0x45ff('0x10')][_0x45ff('0x18')]};}var _0x3df753={'account':_0x1b2f42,'message':{'from':util[_0x45ff('0x19')](_0x45ff('0x1a'),_0x549a86[_0x45ff('0xf')][_0x45ff('0x1b')],_0x549a86['MailAccount']['email']||_0x549a86[_0x45ff('0xf')]['Smtp'][_0x45ff('0x17')]),'to':_0x549a86['email'],'cc':_0x549a86['cc'],'bcc':_0x549a86['bcc'],'subject':util[_0x45ff('0x19')](_0x45ff('0x1c'),_0x3e2b31[_0x45ff('0x1b')],_0x549a86['subtractNumber'],_0x549a86[_0x45ff('0x1d')])}};var _0x1f72a8=path['join'](__dirname,_0x45ff('0x1e'));var _0x237f34=_0x3e2b31[_0x45ff('0x1f')];var _0x2b3763=util[_0x45ff('0x19')]('%s.%s',path[_0x45ff('0x20')](_0x3e2b31[_0x45ff('0x1f')],path[_0x45ff('0x21')](_0x3e2b31['savename'])),_0x45ff('0x22'));var _0x16c415=path[_0x45ff('0x23')](_0x1f72a8,_0x237f34);var _0x4589ea=path[_0x45ff('0x23')](_0x1f72a8,_0x2b3763);if(fs[_0x45ff('0x24')](_0x16c415)){_0x3e2b31['status']=_0x45ff('0x25');_0x3df753['message'][_0x45ff('0x26')]=[{'filename':_0x237f34,'path':_0x16c415}];_0x3df753[_0x45ff('0x27')][_0x45ff('0x28')]=util[_0x45ff('0x19')](_0x45ff('0x29'),JSON['stringify'](_0x3e2b31,null,0x2));}else if(fs['existsSync'](_0x4589ea)){_0x3e2b31[_0x45ff('0x2a')]='Sent';_0x3df753[_0x45ff('0x27')][_0x45ff('0x26')]=[{'filename':_0x2b3763,'path':_0x4589ea}];}else{_0x3df753['message'][_0x45ff('0x28')]=_0x45ff('0x2b');if(!_0x549a86[_0x45ff('0x2c')]){_0x3abf1a=![];logger[_0x45ff('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3abf1a){return client['request'](_0x45ff('0x2d'),_0x3df753)[_0x45ff('0x2e')](function(_0xb15ca1){if(_0xb15ca1[_0x45ff('0x2f')]){return logger[_0x45ff('0x2f')](_0x45ff('0x30'),JSON[_0x45ff('0x31')](_0xb15ca1));}return logger['info']('email\x20sent');})[_0x45ff('0x32')](function(_0x59656e){return logger['error'](_0x45ff('0x30'),JSON['stringify'](_0x59656e));});}};}function handleError(){return function(_0x3b1d19){return logger['error'](JSON[_0x45ff('0x31')](_0x3b1d19));};}function handleResult(_0x355131){return function(_0x52f52b){logger[_0x45ff('0xc')](_0x45ff('0x33'),JSON[_0x45ff('0x31')](_0x52f52b));if(_0x355131['MailAccount']&&_0x355131[_0x45ff('0xf')][_0x45ff('0x10')]&&!_[_0x45ff('0x34')](_0x355131[_0x45ff('0xe')])){setTimeout(handleSendEmail(_0x355131,_0x52f52b),0x3c*0x3e8);}};}function handleJob(_0x2e159f){return function(){try{if(_[_0x45ff('0x34')](_0x2e159f['subtractNumber'])){return logger['info'](_0x45ff('0x35'));}if(_[_0x45ff('0x34')](_0x2e159f[_0x45ff('0x1d')])){return logger[_0x45ff('0xc')](_0x45ff('0x36'));}var _0x544679={'startDate':moment()[_0x45ff('0x37')](_0x2e159f[_0x45ff('0x38')],_0x2e159f[_0x45ff('0x1d')])[_0x45ff('0x19')](_0x45ff('0x39')),'endDate':moment()[_0x45ff('0x19')](_0x45ff('0x39')),'type':_0x45ff('0x3a'),'output':_0x2e159f[_0x45ff('0x3b')],'name':_0x2e159f['name']};if(!_['isNil'](_0x2e159f['DefaultReportId'])){logger[_0x45ff('0xc')](_0x45ff('0x3c'),_0x2e159f[_0x45ff('0x3d')]);return analyticDefaultReportController['runReport']({'id':_0x2e159f[_0x45ff('0x3d')]},_0x544679)[_0x45ff('0x2e')](handleResult(_0x2e159f))['catch'](handleError());}if(!_['isNil'](_0x2e159f['CustomReportId'])){logger[_0x45ff('0xc')]('exec\x20custom\x20report\x20id:%s',_0x2e159f[_0x45ff('0x3e')]);return analyticCustomReportController[_0x45ff('0x3f')]({'id':_0x2e159f[_0x45ff('0x3e')]},_0x544679)[_0x45ff('0x2e')](handleResult(_0x2e159f))[_0x45ff('0x32')](handleError());}}catch(_0x2e9673){logger['error'](JSON[_0x45ff('0x31')](_0x2e9673));}return logger[_0x45ff('0xc')](_0x45ff('0x40'));};}function getJobs(_0x3285ed){var _0x332260={};if(_0x3285ed){_0x332260['id']=_0x3285ed;}return db[_0x45ff('0x41')][_0x45ff('0x42')]({'where':_0x332260,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0x45ff('0xe')],'include':[{'model':db[_0x45ff('0x43')],'as':_0x45ff('0x10')}]}]})[_0x45ff('0x2e')](function(_0x3f8bf9){var _0x531fa9=_[_0x45ff('0x44')](manager[_0x45ff('0x45')]);var _0x39d54c=_[_0x45ff('0x46')](_0x3f8bf9,function(_0x1866f2){return _0x1866f2['id'][_0x45ff('0x47')]();});var _0x23c51e=_['keyBy'](_0x3f8bf9,function(_0x12b8fe){return _0x12b8fe['id'][_0x45ff('0x47')]();});var _0x21ca65=_0x3285ed?_0x39d54c:_[_0x45ff('0x48')](_0x39d54c,_0x531fa9);var _0x127ba6=_[_0x45ff('0x49')](_0x39d54c,_0x531fa9);var _0x2f2501=_[_0x45ff('0x48')](_0x531fa9,_0x39d54c);var _0x450953;var _0x15abfc;for(_0x450953=0x0;_0x450953<_0x2f2501[_0x45ff('0x4a')]&&!_0x3285ed;_0x450953+=0x1){_0x15abfc=_0x2f2501[_0x450953][_0x45ff('0x47')]();if(manager[_0x45ff('0x4b')](_0x15abfc)){manager[_0x45ff('0x4c')](_0x15abfc);manager[_0x45ff('0x4d')](_0x15abfc);logger['info'](_0x45ff('0x4e'),_0x15abfc);}}logger[_0x45ff('0xc')](_0x45ff('0x4f'),JSON['stringify'](_0x21ca65));for(_0x450953=0x0;_0x450953<_0x21ca65['length'];_0x450953+=0x1){_0x15abfc=_0x21ca65[_0x450953][_0x45ff('0x47')]();logger[_0x45ff('0xc')](_0x45ff('0x50'),_0x15abfc);if(_0x3285ed){logger[_0x45ff('0xc')]('my\x20id',_0x3285ed);logger[_0x45ff('0xc')](JSON[_0x45ff('0x31')](_0x23c51e[_0x15abfc]));BPromise[_0x45ff('0x51')]()[_0x45ff('0x2e')](handleJob(_0x23c51e[_0x15abfc]));logger[_0x45ff('0xc')]('run\x20job',_0x23c51e[_0x15abfc][_0x45ff('0x1b')],_0x23c51e[_0x15abfc][_0x45ff('0x52')]);}else if(_0x23c51e[_0x15abfc][_0x45ff('0x52')]&&_0x23c51e[_0x15abfc]['active']&&moment()[_0x45ff('0x53')](_0x23c51e[_0x15abfc][_0x45ff('0x54')],_0x23c51e[_0x15abfc][_0x45ff('0x55')])){manager[_0x45ff('0x56')](_0x15abfc,_0x23c51e[_0x15abfc][_0x45ff('0x52')],handleJob(_0x23c51e[_0x15abfc]));manager[_0x45ff('0x57')](_0x15abfc);logger[_0x45ff('0xc')](_0x45ff('0x58'),_0x23c51e[_0x15abfc][_0x45ff('0x1b')],_0x23c51e[_0x15abfc][_0x45ff('0x52')]);}else if(manager[_0x45ff('0x4b')](_0x15abfc)){manager[_0x45ff('0x4c')](_0x15abfc);manager[_0x45ff('0x4d')](_0x15abfc);logger[_0x45ff('0xc')]('stop\x20cron',_0x23c51e[_0x15abfc][_0x45ff('0x1b')],_0x23c51e[_0x15abfc]['cron']);}}for(_0x450953=0x0,_0x15abfc;_0x450953<_0x127ba6[_0x45ff('0x4a')]&&!_0x3285ed;_0x450953+=0x1){_0x15abfc=_0x127ba6[_0x450953][_0x45ff('0x47')]();if(manager[_0x45ff('0x4b')](_0x15abfc)){if(_0x23c51e[_0x15abfc][_0x45ff('0x52')]&&_0x23c51e[_0x15abfc][_0x45ff('0x59')]&&moment()[_0x45ff('0x53')](_0x23c51e[_0x15abfc]['startAt'],_0x23c51e[_0x15abfc][_0x45ff('0x55')])){manager[_0x45ff('0x5a')](_0x15abfc,_0x23c51e[_0x15abfc][_0x45ff('0x52')],handleJob(_0x23c51e[_0x15abfc]));logger['info'](_0x45ff('0x5b'),_0x23c51e[_0x15abfc][_0x45ff('0x1b')],_0x23c51e[_0x15abfc][_0x45ff('0x52')]);}else{manager['stop'](_0x15abfc);manager[_0x45ff('0x4d')](_0x15abfc);logger[_0x45ff('0xc')](_0x45ff('0x5c'),_0x23c51e[_0x15abfc][_0x45ff('0x1b')],_0x23c51e[_0x15abfc][_0x45ff('0x52')]);}}}})[_0x45ff('0x32')](function(_0x5d46a4){logger[_0x45ff('0x2f')](JSON[_0x45ff('0x31')](_0x5d46a4));});}exports[_0x45ff('0x5d')]=function(_0x1cd046){return getJobs(_0x1cd046);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x58f6=['name','subtractUnit','join','../../files/reports','%s.%s','savename','extname','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','catch','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','length','update\x20cron','stop\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','bcc','format','Report\x20%s\x20last\x20%s\x20%s'];(function(_0x442cff,_0x2e24fd){var _0x1ccf05=function(_0x45deae){while(--_0x45deae){_0x442cff['push'](_0x442cff['shift']());}};_0x1ccf05(++_0x2e24fd);}(_0x58f6,0x148));var _0x658f=function(_0x79c1f3,_0x51835f){_0x79c1f3=_0x79c1f3-0x0;var _0x46592d=_0x58f6[_0x79c1f3];return _0x46592d;};'use strict';var fs=require('fs');var util=require(_0x658f('0x0'));var path=require(_0x658f('0x1'));var _=require(_0x658f('0x2'));var moment=require(_0x658f('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x658f('0x4'));var BPromise=require(_0x658f('0x5'));var logger=require(_0x658f('0x6'))('schedule');var db=require(_0x658f('0x7'))['db'];var analyticCustomReportController=require(_0x658f('0x8'));var analyticDefaultReportController=require(_0x658f('0x9'));var client=jayson[_0x658f('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5729a9,_0x63f920){return function(){logger[_0x658f('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5729a9[_0x658f('0xc')]);var _0x302171=!![];var _0xd8ac15=_0x5729a9[_0x658f('0xd')][_0x658f('0xe')]();var _0x126b31={'account':_0xd8ac15,'message':{'from':util['format'](_0x658f('0xf'),_0x5729a9[_0x658f('0xd')]['name'],_0x5729a9[_0x658f('0xd')][_0x658f('0xc')]||_0x5729a9[_0x658f('0xd')][_0x658f('0x10')]['user']),'to':_0x5729a9[_0x658f('0xc')],'cc':_0x5729a9['cc'],'bcc':_0x5729a9[_0x658f('0x11')],'subject':util[_0x658f('0x12')](_0x658f('0x13'),_0x63f920[_0x658f('0x14')],_0x5729a9['subtractNumber'],_0x5729a9[_0x658f('0x15')])}};var _0x2fa55d=path[_0x658f('0x16')](__dirname,_0x658f('0x17'));var _0x5d7d10=_0x63f920['savename'];var _0x36aa07=util[_0x658f('0x12')](_0x658f('0x18'),path['basename'](_0x63f920[_0x658f('0x19')],path[_0x658f('0x1a')](_0x63f920[_0x658f('0x19')])),_0x658f('0x1b'));var _0x1d413f=path['join'](_0x2fa55d,_0x5d7d10);var _0x3392c4=path['join'](_0x2fa55d,_0x36aa07);if(fs['existsSync'](_0x1d413f)){_0x63f920[_0x658f('0x1c')]=_0x658f('0x1d');_0x126b31[_0x658f('0x1e')][_0x658f('0x1f')]=[{'filename':_0x5d7d10,'path':_0x1d413f}];_0x126b31['message'][_0x658f('0x20')]=util[_0x658f('0x12')](_0x658f('0x21'),JSON[_0x658f('0x22')](_0x63f920,null,0x2));}else if(fs[_0x658f('0x23')](_0x3392c4)){_0x63f920['status']=_0x658f('0x1d');_0x126b31[_0x658f('0x1e')][_0x658f('0x1f')]=[{'filename':_0x36aa07,'path':_0x3392c4}];}else{_0x126b31[_0x658f('0x1e')][_0x658f('0x20')]=_0x658f('0x24');if(!_0x5729a9['sendIfEmpty']){_0x302171=![];logger['info'](_0x658f('0x25'));}}if(_0x302171){return client[_0x658f('0x26')](_0x658f('0x27'),_0x126b31)['then'](function(_0x153bd0){if(_0x153bd0[_0x658f('0x28')]){return logger['error'](_0x658f('0x29'),JSON['stringify'](_0x153bd0));}return logger[_0x658f('0xb')](_0x658f('0x2a'));})['catch'](function(_0x2053a6){return logger[_0x658f('0x28')](_0x658f('0x29'),JSON['stringify'](_0x2053a6));});}};}function handleError(){return function(_0x1c106c){return logger[_0x658f('0x28')](JSON[_0x658f('0x22')](_0x1c106c));};}function handleResult(_0x581713){return function(_0x21cab2){logger[_0x658f('0xb')](_0x658f('0x2b'),JSON[_0x658f('0x22')](_0x21cab2));if(_0x581713[_0x658f('0xd')]&&_0x581713[_0x658f('0xd')][_0x658f('0x10')]&&!_[_0x658f('0x2c')](_0x581713[_0x658f('0xc')])){setTimeout(handleSendEmail(_0x581713,_0x21cab2),0x3c*0x3e8);}};}function handleJob(_0x3aca0d){return function(){try{if(_[_0x658f('0x2c')](_0x3aca0d[_0x658f('0x2d')])){return logger['info'](_0x658f('0x2e'));}if(_['isNil'](_0x3aca0d[_0x658f('0x15')])){return logger[_0x658f('0xb')](_0x658f('0x2f'));}var _0x45d6ac={'startDate':moment()[_0x658f('0x30')](_0x3aca0d['subtractNumber'],_0x3aca0d['subtractUnit'])[_0x658f('0x12')](_0x658f('0x31')),'endDate':moment()['format'](_0x658f('0x31')),'type':_0x658f('0x32'),'output':_0x3aca0d[_0x658f('0x33')],'name':_0x3aca0d[_0x658f('0x14')]};if(!_['isNil'](_0x3aca0d['DefaultReportId'])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x3aca0d[_0x658f('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x3aca0d[_0x658f('0x34')]},_0x45d6ac)[_0x658f('0x35')](handleResult(_0x3aca0d))[_0x658f('0x36')](handleError());}if(!_['isNil'](_0x3aca0d[_0x658f('0x37')])){logger[_0x658f('0xb')]('exec\x20custom\x20report\x20id:%s',_0x3aca0d[_0x658f('0x37')]);return analyticCustomReportController[_0x658f('0x38')]({'id':_0x3aca0d[_0x658f('0x37')]},_0x45d6ac)[_0x658f('0x35')](handleResult(_0x3aca0d))[_0x658f('0x36')](handleError());}}catch(_0x147f4c){logger[_0x658f('0x28')](JSON['stringify'](_0x147f4c));}return logger['info'](_0x658f('0x39'));};}function getJobs(_0x2c23db){var _0x50a497={};if(_0x2c23db){_0x50a497['id']=_0x2c23db;}return db[_0x658f('0x3a')][_0x658f('0x3b')]({'where':_0x50a497,'include':[{'model':db[_0x658f('0xd')],'attributes':['id','name',_0x658f('0xc')],'include':[{'model':db[_0x658f('0x3c')],'as':_0x658f('0x10'),'include':[{'model':db[_0x658f('0x3d')],'as':'CloudProvider'}]}]}]})[_0x658f('0x35')](function(_0x4ea2cb){var _0x26256f=_[_0x658f('0x3e')](manager['jobs']);var _0x178355=_[_0x658f('0x3f')](_0x4ea2cb,function(_0x5f00ab){return _0x5f00ab['id'][_0x658f('0x40')]();});var _0x28d714=_['keyBy'](_0x4ea2cb,function(_0x548986){return _0x548986['id'][_0x658f('0x40')]();});var _0x408c61=_0x2c23db?_0x178355:_[_0x658f('0x41')](_0x178355,_0x26256f);var _0x15180d=_[_0x658f('0x42')](_0x178355,_0x26256f);var _0x202317=_[_0x658f('0x41')](_0x26256f,_0x178355);var _0x447ac1;var _0x29f3c5;for(_0x447ac1=0x0;_0x447ac1<_0x202317['length']&&!_0x2c23db;_0x447ac1+=0x1){_0x29f3c5=_0x202317[_0x447ac1][_0x658f('0x40')]();if(manager[_0x658f('0x43')](_0x29f3c5)){manager[_0x658f('0x44')](_0x29f3c5);manager[_0x658f('0x45')](_0x29f3c5);logger[_0x658f('0xb')](_0x658f('0x46'),_0x29f3c5);}}logger[_0x658f('0xb')](_0x658f('0x47'),JSON[_0x658f('0x22')](_0x408c61));for(_0x447ac1=0x0;_0x447ac1<_0x408c61['length'];_0x447ac1+=0x1){_0x29f3c5=_0x408c61[_0x447ac1][_0x658f('0x40')]();logger[_0x658f('0xb')]('index',_0x29f3c5);if(_0x2c23db){logger['info'](_0x658f('0x48'),_0x2c23db);logger[_0x658f('0xb')](JSON['stringify'](_0x28d714[_0x29f3c5]));BPromise[_0x658f('0x49')]()[_0x658f('0x35')](handleJob(_0x28d714[_0x29f3c5]));logger['info'](_0x658f('0x4a'),_0x28d714[_0x29f3c5]['name'],_0x28d714[_0x29f3c5][_0x658f('0x4b')]);}else if(_0x28d714[_0x29f3c5][_0x658f('0x4b')]&&_0x28d714[_0x29f3c5][_0x658f('0x4c')]&&moment()[_0x658f('0x4d')](_0x28d714[_0x29f3c5][_0x658f('0x4e')],_0x28d714[_0x29f3c5][_0x658f('0x4f')])){manager[_0x658f('0x50')](_0x29f3c5,_0x28d714[_0x29f3c5][_0x658f('0x4b')],handleJob(_0x28d714[_0x29f3c5]));manager[_0x658f('0x51')](_0x29f3c5);logger['info'](_0x658f('0x52'),_0x28d714[_0x29f3c5][_0x658f('0x14')],_0x28d714[_0x29f3c5][_0x658f('0x4b')]);}else if(manager[_0x658f('0x43')](_0x29f3c5)){manager[_0x658f('0x44')](_0x29f3c5);manager[_0x658f('0x45')](_0x29f3c5);logger[_0x658f('0xb')]('stop\x20cron',_0x28d714[_0x29f3c5]['name'],_0x28d714[_0x29f3c5][_0x658f('0x4b')]);}}for(_0x447ac1=0x0,_0x29f3c5;_0x447ac1<_0x15180d[_0x658f('0x53')]&&!_0x2c23db;_0x447ac1+=0x1){_0x29f3c5=_0x15180d[_0x447ac1]['toString']();if(manager[_0x658f('0x43')](_0x29f3c5)){if(_0x28d714[_0x29f3c5][_0x658f('0x4b')]&&_0x28d714[_0x29f3c5][_0x658f('0x4c')]&&moment()['isBetween'](_0x28d714[_0x29f3c5]['startAt'],_0x28d714[_0x29f3c5][_0x658f('0x4f')])){manager['update'](_0x29f3c5,_0x28d714[_0x29f3c5][_0x658f('0x4b')],handleJob(_0x28d714[_0x29f3c5]));logger[_0x658f('0xb')](_0x658f('0x54'),_0x28d714[_0x29f3c5][_0x658f('0x14')],_0x28d714[_0x29f3c5]['cron']);}else{manager['stop'](_0x29f3c5);manager[_0x658f('0x45')](_0x29f3c5);logger['info'](_0x658f('0x55'),_0x28d714[_0x29f3c5][_0x658f('0x14')],_0x28d714[_0x29f3c5]['cron']);}}}})['catch'](function(_0x5bb125){logger[_0x658f('0x28')](JSON[_0x658f('0x22')](_0x5bb125));});}exports[_0x658f('0x56')]=function(_0x287a45){return getJobs(_0x287a45);};exports[_0x658f('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file