Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / config / schedule / index.js
index 87c7ac4..49eaeca 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 _0x2f73=['message','attachments','text','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','email\x20sent','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','stop\x20cron','isBetween','update','update\x20cron','run','lodash','moment','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','zip','join','existsSync','status','Sent'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x2f73,0x18e));var _0x32f7=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x2f73[_0x2fa457];return _0x4f250a;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x32f7('0x0'));var moment=require(_0x32f7('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x32f7('0x2'));var logger=require(_0x32f7('0x3'))('schedule');var db=require(_0x32f7('0x4'))['db'];var analyticCustomReportController=require(_0x32f7('0x5'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x32f7('0x6')][_0x32f7('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x458bf4,_0x44f891){return function(){logger['info'](_0x32f7('0x8'),_0x458bf4[_0x32f7('0x9')]);var _0x275b2f=!![];var _0x210b92={'tls':{'rejectUnauthorized':![]}};if(_0x458bf4[_0x32f7('0xa')]['Smtp']['service']){_0x210b92['service']=_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')]['service'];}else{_0x210b92[_0x32f7('0xc')]=_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')]['host'];_0x210b92[_0x32f7('0xd')]=_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')][_0x32f7('0xd')];_0x210b92[_0x32f7('0xe')]=_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')]['secure'];}if(_0x458bf4[_0x32f7('0xa')]['Smtp']['authentication']){_0x210b92[_0x32f7('0xf')]={'user':_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')][_0x32f7('0x10')],'pass':_0x458bf4[_0x32f7('0xa')][_0x32f7('0xb')][_0x32f7('0x11')]};}var _0x31b2f0={'account':_0x210b92,'message':{'from':util[_0x32f7('0x12')](_0x32f7('0x13'),_0x458bf4[_0x32f7('0xa')][_0x32f7('0x14')],_0x458bf4[_0x32f7('0xa')][_0x32f7('0x9')]||_0x458bf4[_0x32f7('0xa')]['Smtp'][_0x32f7('0x10')]),'to':_0x458bf4['email'],'cc':_0x458bf4['cc'],'bcc':_0x458bf4[_0x32f7('0x15')],'subject':util[_0x32f7('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x44f891[_0x32f7('0x14')],_0x458bf4[_0x32f7('0x16')],_0x458bf4[_0x32f7('0x17')])}};var _0x56bbff=path['join'](__dirname,_0x32f7('0x18'));var _0x238cd0=_0x44f891[_0x32f7('0x19')];var _0xb07d11=util[_0x32f7('0x12')](_0x32f7('0x1a'),path['basename'](_0x44f891['savename'],path['extname'](_0x44f891[_0x32f7('0x19')])),_0x32f7('0x1b'));var _0x10b795=path[_0x32f7('0x1c')](_0x56bbff,_0x238cd0);var _0x4a6ef4=path[_0x32f7('0x1c')](_0x56bbff,_0xb07d11);if(fs[_0x32f7('0x1d')](_0x10b795)){_0x44f891[_0x32f7('0x1e')]=_0x32f7('0x1f');_0x31b2f0[_0x32f7('0x20')][_0x32f7('0x21')]=[{'filename':_0x238cd0,'path':_0x10b795}];_0x31b2f0[_0x32f7('0x20')][_0x32f7('0x22')]=util[_0x32f7('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x44f891,null,0x2));}else if(fs['existsSync'](_0x4a6ef4)){_0x44f891[_0x32f7('0x1e')]=_0x32f7('0x1f');_0x31b2f0['message']['attachments']=[{'filename':_0xb07d11,'path':_0x4a6ef4}];}else{_0x31b2f0[_0x32f7('0x20')]['text']=_0x32f7('0x23');if(!_0x458bf4[_0x32f7('0x24')]){_0x275b2f=![];logger[_0x32f7('0x25')](_0x32f7('0x26'));}}if(_0x275b2f){return client[_0x32f7('0x27')](_0x32f7('0x28'),_0x31b2f0)[_0x32f7('0x29')](function(_0x1df565){if(_0x1df565[_0x32f7('0x2a')]){return logger[_0x32f7('0x2a')](_0x32f7('0x2b'),JSON['stringify'](_0x1df565));}return logger[_0x32f7('0x25')](_0x32f7('0x2c'));})['catch'](function(_0x3f63a9){return logger[_0x32f7('0x2a')](_0x32f7('0x2b'),JSON[_0x32f7('0x2d')](_0x3f63a9));});}};}function handleError(){return function(_0x46850b){return logger[_0x32f7('0x2a')](JSON[_0x32f7('0x2d')](_0x46850b));};}function handleResult(_0x69742){return function(_0x3a8409){logger[_0x32f7('0x25')]('data',JSON[_0x32f7('0x2d')](_0x3a8409));if(_0x69742['MailAccount']&&_0x69742['MailAccount'][_0x32f7('0xb')]&&!_['isNil'](_0x69742[_0x32f7('0x9')])){setTimeout(handleSendEmail(_0x69742,_0x3a8409),0x3c*0x3e8);}};}function handleJob(_0x50487d){return function(){try{if(_[_0x32f7('0x2e')](_0x50487d[_0x32f7('0x16')])){return logger[_0x32f7('0x25')](_0x32f7('0x2f'));}if(_[_0x32f7('0x2e')](_0x50487d[_0x32f7('0x17')])){return logger[_0x32f7('0x25')](_0x32f7('0x30'));}var _0x48a97d={'startDate':moment()[_0x32f7('0x31')](_0x50487d['subtractNumber'],_0x50487d[_0x32f7('0x17')])[_0x32f7('0x12')](_0x32f7('0x32')),'endDate':moment()[_0x32f7('0x12')](_0x32f7('0x32')),'type':_0x32f7('0x33'),'output':_0x50487d[_0x32f7('0x34')],'name':_0x50487d[_0x32f7('0x14')]};if(!_[_0x32f7('0x2e')](_0x50487d[_0x32f7('0x35')])){logger[_0x32f7('0x25')]('exec\x20defaul\x20report\x20id:%s',_0x50487d[_0x32f7('0x35')]);return analyticDefaultReportController[_0x32f7('0x36')]({'id':_0x50487d[_0x32f7('0x35')]},_0x48a97d)[_0x32f7('0x29')](handleResult(_0x50487d))[_0x32f7('0x37')](handleError());}if(!_[_0x32f7('0x2e')](_0x50487d[_0x32f7('0x38')])){logger[_0x32f7('0x25')](_0x32f7('0x39'),_0x50487d['CustomReportId']);return analyticCustomReportController[_0x32f7('0x36')]({'id':_0x50487d[_0x32f7('0x38')]},_0x48a97d)[_0x32f7('0x29')](handleResult(_0x50487d))[_0x32f7('0x37')](handleError());}}catch(_0x40b002){logger['error'](JSON[_0x32f7('0x2d')](_0x40b002));}return logger[_0x32f7('0x25')](_0x32f7('0x3a'));};}function getJobs(_0x4095df){var _0x34cd70={};if(_0x4095df){_0x34cd70['id']=_0x4095df;}return db[_0x32f7('0x3b')]['findAll']({'where':_0x34cd70,'include':[{'model':db['MailAccount'],'attributes':['id',_0x32f7('0x14'),_0x32f7('0x9')],'include':[{'model':db[_0x32f7('0x3c')],'as':_0x32f7('0xb')}]}]})[_0x32f7('0x29')](function(_0x130b30){var _0x59832f=_['keys'](manager[_0x32f7('0x3d')]);var _0xbe817a=_[_0x32f7('0x3e')](_0x130b30,function(_0x31b0f5){return _0x31b0f5['id']['toString']();});var _0x5f9200=_[_0x32f7('0x3f')](_0x130b30,function(_0x329a17){return _0x329a17['id'][_0x32f7('0x40')]();});var _0x50ac0a=_0x4095df?_0xbe817a:_[_0x32f7('0x41')](_0xbe817a,_0x59832f);var _0x113a1b=_[_0x32f7('0x42')](_0xbe817a,_0x59832f);var _0x12eb1f=_[_0x32f7('0x41')](_0x59832f,_0xbe817a);var _0x4ebfcf;var _0x306a6d;for(_0x4ebfcf=0x0;_0x4ebfcf<_0x12eb1f[_0x32f7('0x43')]&&!_0x4095df;_0x4ebfcf+=0x1){_0x306a6d=_0x12eb1f[_0x4ebfcf][_0x32f7('0x40')]();if(manager[_0x32f7('0x44')](_0x306a6d)){manager[_0x32f7('0x45')](_0x306a6d);manager[_0x32f7('0x46')](_0x306a6d);logger[_0x32f7('0x25')]('delete\x20cron',_0x306a6d);}}logger[_0x32f7('0x25')](_0x32f7('0x47'),JSON[_0x32f7('0x2d')](_0x50ac0a));for(_0x4ebfcf=0x0;_0x4ebfcf<_0x50ac0a[_0x32f7('0x43')];_0x4ebfcf+=0x1){_0x306a6d=_0x50ac0a[_0x4ebfcf][_0x32f7('0x40')]();logger[_0x32f7('0x25')]('index',_0x306a6d);if(_0x4095df){logger[_0x32f7('0x25')](_0x32f7('0x48'),_0x4095df);logger[_0x32f7('0x25')](JSON[_0x32f7('0x2d')](_0x5f9200[_0x306a6d]));BPromise[_0x32f7('0x49')]()[_0x32f7('0x29')](handleJob(_0x5f9200[_0x306a6d]));logger[_0x32f7('0x25')](_0x32f7('0x4a'),_0x5f9200[_0x306a6d]['name'],_0x5f9200[_0x306a6d][_0x32f7('0x4b')]);}else if(_0x5f9200[_0x306a6d][_0x32f7('0x4b')]&&_0x5f9200[_0x306a6d][_0x32f7('0x4c')]&&moment()['isBetween'](_0x5f9200[_0x306a6d][_0x32f7('0x4d')],_0x5f9200[_0x306a6d][_0x32f7('0x4e')])){manager[_0x32f7('0x4f')](_0x306a6d,_0x5f9200[_0x306a6d][_0x32f7('0x4b')],handleJob(_0x5f9200[_0x306a6d]));manager[_0x32f7('0x50')](_0x306a6d);logger[_0x32f7('0x25')]('add\x20cron',_0x5f9200[_0x306a6d][_0x32f7('0x14')],_0x5f9200[_0x306a6d][_0x32f7('0x4b')]);}else if(manager['exists'](_0x306a6d)){manager['stop'](_0x306a6d);manager[_0x32f7('0x46')](_0x306a6d);logger[_0x32f7('0x25')](_0x32f7('0x51'),_0x5f9200[_0x306a6d][_0x32f7('0x14')],_0x5f9200[_0x306a6d]['cron']);}}for(_0x4ebfcf=0x0,_0x306a6d;_0x4ebfcf<_0x113a1b['length']&&!_0x4095df;_0x4ebfcf+=0x1){_0x306a6d=_0x113a1b[_0x4ebfcf][_0x32f7('0x40')]();if(manager[_0x32f7('0x44')](_0x306a6d)){if(_0x5f9200[_0x306a6d][_0x32f7('0x4b')]&&_0x5f9200[_0x306a6d][_0x32f7('0x4c')]&&moment()[_0x32f7('0x52')](_0x5f9200[_0x306a6d][_0x32f7('0x4d')],_0x5f9200[_0x306a6d][_0x32f7('0x4e')])){manager[_0x32f7('0x53')](_0x306a6d,_0x5f9200[_0x306a6d][_0x32f7('0x4b')],handleJob(_0x5f9200[_0x306a6d]));logger[_0x32f7('0x25')](_0x32f7('0x54'),_0x5f9200[_0x306a6d][_0x32f7('0x14')],_0x5f9200[_0x306a6d][_0x32f7('0x4b')]);}else{manager[_0x32f7('0x45')](_0x306a6d);manager[_0x32f7('0x46')](_0x306a6d);logger[_0x32f7('0x25')](_0x32f7('0x51'),_0x5f9200[_0x306a6d][_0x32f7('0x14')],_0x5f9200[_0x306a6d][_0x32f7('0x4b')]);}}}})[_0x32f7('0x37')](function(_0x324219){logger[_0x32f7('0x2a')](JSON[_0x32f7('0x2d')](_0x324219));});}exports[_0x32f7('0x55')]=function(_0x42668d){return getJobs(_0x42668d);};exports[_0x32f7('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file