Built motion from commit a679711e.|2.6.15
[motion2.git] / server / config / schedule / index.js
index 87c7ac4..9eaf5e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc74e=['pass','format','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','savename','basename','extname','zip','join','existsSync','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','deleteJob','toRun','index','my\x20id','resolve','cron','active','startAt','endAt','add','add\x20cron','exists','stop','stop\x20cron','update\x20cron','start','path','lodash','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','auth'];(function(_0x10c2ef,_0x275d3c){var _0x27b0ff=function(_0x5cc9c7){while(--_0x5cc9c7){_0x10c2ef['push'](_0x10c2ef['shift']());}};_0x27b0ff(++_0x275d3c);}(_0xc74e,0x154));var _0xec74=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc74e[_0x17d9e3];return _0x14192d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xec74('0x0'));var _=require(_0xec74('0x1'));var moment=require(_0xec74('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xec74('0x3'));var BPromise=require(_0xec74('0x4'));var logger=require(_0xec74('0x5'))('schedule');var db=require(_0xec74('0x6'))['db'];var analyticCustomReportController=require(_0xec74('0x7'));var analyticDefaultReportController=require(_0xec74('0x8'));var client=jayson[_0xec74('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x470fad,_0x492f06){return function(){logger['info'](_0xec74('0xa'),_0x470fad[_0xec74('0xb')]);var _0x3081db=!![];var _0x402e5d={'tls':{'rejectUnauthorized':![]}};if(_0x470fad['MailAccount'][_0xec74('0xc')]['service']){_0x402e5d[_0xec74('0xd')]=_0x470fad[_0xec74('0xe')][_0xec74('0xc')][_0xec74('0xd')];}else{_0x402e5d[_0xec74('0xf')]=_0x470fad[_0xec74('0xe')][_0xec74('0xc')][_0xec74('0xf')];_0x402e5d['port']=_0x470fad['MailAccount'][_0xec74('0xc')][_0xec74('0x10')];_0x402e5d[_0xec74('0x11')]=_0x470fad['MailAccount'][_0xec74('0xc')][_0xec74('0x11')];}if(_0x470fad[_0xec74('0xe')][_0xec74('0xc')][_0xec74('0x12')]){_0x402e5d[_0xec74('0x13')]={'user':_0x470fad['MailAccount'][_0xec74('0xc')]['user'],'pass':_0x470fad[_0xec74('0xe')][_0xec74('0xc')][_0xec74('0x14')]};}var _0x50f003={'account':_0x402e5d,'message':{'from':util[_0xec74('0x15')]('\x22%s\x22\x20<%s>',_0x470fad[_0xec74('0xe')][_0xec74('0x16')],_0x470fad[_0xec74('0xe')]['email']||_0x470fad[_0xec74('0xe')]['Smtp'][_0xec74('0x17')]),'to':_0x470fad[_0xec74('0xb')],'cc':_0x470fad['cc'],'bcc':_0x470fad[_0xec74('0x18')],'subject':util[_0xec74('0x15')](_0xec74('0x19'),_0x492f06['name'],_0x470fad[_0xec74('0x1a')],_0x470fad['subtractUnit'])}};var _0x31efc4=path['join'](__dirname,_0xec74('0x1b'));var _0x43b329=_0x492f06[_0xec74('0x1c')];var _0x192024=util['format']('%s.%s',path[_0xec74('0x1d')](_0x492f06[_0xec74('0x1c')],path[_0xec74('0x1e')](_0x492f06[_0xec74('0x1c')])),_0xec74('0x1f'));var _0x534ff8=path[_0xec74('0x20')](_0x31efc4,_0x43b329);var _0x458a68=path[_0xec74('0x20')](_0x31efc4,_0x192024);if(fs[_0xec74('0x21')](_0x534ff8)){_0x492f06[_0xec74('0x22')]=_0xec74('0x23');_0x50f003[_0xec74('0x24')][_0xec74('0x25')]=[{'filename':_0x43b329,'path':_0x534ff8}];_0x50f003['message'][_0xec74('0x26')]=util['format'](_0xec74('0x27'),JSON['stringify'](_0x492f06,null,0x2));}else if(fs[_0xec74('0x21')](_0x458a68)){_0x492f06[_0xec74('0x22')]='Sent';_0x50f003[_0xec74('0x24')]['attachments']=[{'filename':_0x192024,'path':_0x458a68}];}else{_0x50f003[_0xec74('0x24')][_0xec74('0x26')]=_0xec74('0x28');if(!_0x470fad[_0xec74('0x29')]){_0x3081db=![];logger[_0xec74('0x2a')](_0xec74('0x2b'));}}if(_0x3081db){return client[_0xec74('0x2c')](_0xec74('0x2d'),_0x50f003)[_0xec74('0x2e')](function(_0x4405f5){if(_0x4405f5[_0xec74('0x2f')]){return logger[_0xec74('0x2f')](_0xec74('0x30'),JSON[_0xec74('0x31')](_0x4405f5));}return logger[_0xec74('0x2a')](_0xec74('0x32'));})[_0xec74('0x33')](function(_0x13b14e){return logger[_0xec74('0x2f')](_0xec74('0x30'),JSON[_0xec74('0x31')](_0x13b14e));});}};}function handleError(){return function(_0x213d18){return logger[_0xec74('0x2f')](JSON[_0xec74('0x31')](_0x213d18));};}function handleResult(_0x772d16){return function(_0xcb71d7){logger['info'](_0xec74('0x34'),JSON[_0xec74('0x31')](_0xcb71d7));if(_0x772d16[_0xec74('0xe')]&&_0x772d16[_0xec74('0xe')][_0xec74('0xc')]&&!_[_0xec74('0x35')](_0x772d16[_0xec74('0xb')])){setTimeout(handleSendEmail(_0x772d16,_0xcb71d7),0x3c*0x3e8);}};}function handleJob(_0x136671){return function(){try{if(_[_0xec74('0x35')](_0x136671[_0xec74('0x1a')])){return logger[_0xec74('0x2a')](_0xec74('0x36'));}if(_[_0xec74('0x35')](_0x136671['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x25a77b={'startDate':moment()[_0xec74('0x37')](_0x136671['subtractNumber'],_0x136671['subtractUnit'])['format'](_0xec74('0x38')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xec74('0x39'),'output':_0x136671[_0xec74('0x3a')],'name':_0x136671[_0xec74('0x16')]};if(!_['isNil'](_0x136671[_0xec74('0x3b')])){logger['info'](_0xec74('0x3c'),_0x136671['DefaultReportId']);return analyticDefaultReportController[_0xec74('0x3d')]({'id':_0x136671['DefaultReportId']},_0x25a77b)[_0xec74('0x2e')](handleResult(_0x136671))[_0xec74('0x33')](handleError());}if(!_[_0xec74('0x35')](_0x136671[_0xec74('0x3e')])){logger[_0xec74('0x2a')](_0xec74('0x3f'),_0x136671['CustomReportId']);return analyticCustomReportController[_0xec74('0x3d')]({'id':_0x136671[_0xec74('0x3e')]},_0x25a77b)['then'](handleResult(_0x136671))['catch'](handleError());}}catch(_0x29cb9e){logger[_0xec74('0x2f')](JSON[_0xec74('0x31')](_0x29cb9e));}return logger[_0xec74('0x2a')](_0xec74('0x40'));};}function getJobs(_0x2437a0){var _0x40a399={};if(_0x2437a0){_0x40a399['id']=_0x2437a0;}return db[_0xec74('0x41')]['findAll']({'where':_0x40a399,'include':[{'model':db[_0xec74('0xe')],'attributes':['id',_0xec74('0x16'),_0xec74('0xb')],'include':[{'model':db[_0xec74('0x42')],'as':_0xec74('0xc')}]}]})['then'](function(_0x1c07e2){var _0x1c0767=_[_0xec74('0x43')](manager[_0xec74('0x44')]);var _0x3981bd=_[_0xec74('0x45')](_0x1c07e2,function(_0x338dbd){return _0x338dbd['id'][_0xec74('0x46')]();});var _0x474e79=_[_0xec74('0x47')](_0x1c07e2,function(_0x2be8e7){return _0x2be8e7['id'][_0xec74('0x46')]();});var _0x111ade=_0x2437a0?_0x3981bd:_[_0xec74('0x48')](_0x3981bd,_0x1c0767);var _0x431120=_['intersection'](_0x3981bd,_0x1c0767);var _0x55d554=_['difference'](_0x1c0767,_0x3981bd);var _0x2d3b30;var _0x3da467;for(_0x2d3b30=0x0;_0x2d3b30<_0x55d554[_0xec74('0x49')]&&!_0x2437a0;_0x2d3b30+=0x1){_0x3da467=_0x55d554[_0x2d3b30][_0xec74('0x46')]();if(manager['exists'](_0x3da467)){manager['stop'](_0x3da467);manager[_0xec74('0x4a')](_0x3da467);logger[_0xec74('0x2a')]('delete\x20cron',_0x3da467);}}logger[_0xec74('0x2a')](_0xec74('0x4b'),JSON['stringify'](_0x111ade));for(_0x2d3b30=0x0;_0x2d3b30<_0x111ade['length'];_0x2d3b30+=0x1){_0x3da467=_0x111ade[_0x2d3b30]['toString']();logger['info'](_0xec74('0x4c'),_0x3da467);if(_0x2437a0){logger['info'](_0xec74('0x4d'),_0x2437a0);logger[_0xec74('0x2a')](JSON[_0xec74('0x31')](_0x474e79[_0x3da467]));BPromise[_0xec74('0x4e')]()['then'](handleJob(_0x474e79[_0x3da467]));logger[_0xec74('0x2a')]('run\x20job',_0x474e79[_0x3da467][_0xec74('0x16')],_0x474e79[_0x3da467][_0xec74('0x4f')]);}else if(_0x474e79[_0x3da467][_0xec74('0x4f')]&&_0x474e79[_0x3da467][_0xec74('0x50')]&&moment()['isBetween'](_0x474e79[_0x3da467][_0xec74('0x51')],_0x474e79[_0x3da467][_0xec74('0x52')])){manager[_0xec74('0x53')](_0x3da467,_0x474e79[_0x3da467]['cron'],handleJob(_0x474e79[_0x3da467]));manager['start'](_0x3da467);logger[_0xec74('0x2a')](_0xec74('0x54'),_0x474e79[_0x3da467][_0xec74('0x16')],_0x474e79[_0x3da467][_0xec74('0x4f')]);}else if(manager[_0xec74('0x55')](_0x3da467)){manager[_0xec74('0x56')](_0x3da467);manager[_0xec74('0x4a')](_0x3da467);logger[_0xec74('0x2a')](_0xec74('0x57'),_0x474e79[_0x3da467]['name'],_0x474e79[_0x3da467]['cron']);}}for(_0x2d3b30=0x0,_0x3da467;_0x2d3b30<_0x431120[_0xec74('0x49')]&&!_0x2437a0;_0x2d3b30+=0x1){_0x3da467=_0x431120[_0x2d3b30]['toString']();if(manager[_0xec74('0x55')](_0x3da467)){if(_0x474e79[_0x3da467]['cron']&&_0x474e79[_0x3da467][_0xec74('0x50')]&&moment()['isBetween'](_0x474e79[_0x3da467][_0xec74('0x51')],_0x474e79[_0x3da467][_0xec74('0x52')])){manager['update'](_0x3da467,_0x474e79[_0x3da467]['cron'],handleJob(_0x474e79[_0x3da467]));logger[_0xec74('0x2a')](_0xec74('0x58'),_0x474e79[_0x3da467]['name'],_0x474e79[_0x3da467][_0xec74('0x4f')]);}else{manager['stop'](_0x3da467);manager[_0xec74('0x4a')](_0x3da467);logger[_0xec74('0x2a')](_0xec74('0x57'),_0x474e79[_0x3da467][_0xec74('0x16')],_0x474e79[_0x3da467][_0xec74('0x4f')]);}}}})[_0xec74('0x33')](function(_0x59bd35){logger['error'](JSON[_0xec74('0x31')](_0x59bd35));});}exports['run']=function(_0x47fc10){return getJobs(_0x47fc10);};exports[_0xec74('0x59')]=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