Built motion from commit (unavailable).|2.5.24
[motion2.git] / server / config / schedule / index.js
index 87c7ac4..1223742 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 _0xbcf9=['stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','endAt','add','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../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','pass','format','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','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'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbcf9,0xef));var _0x9bcf=function(_0x324989,_0x1a8db4){_0x324989=_0x324989-0x0;var _0xc94fc8=_0xbcf9[_0x324989];return _0xc94fc8;};'use strict';var fs=require('fs');var util=require(_0x9bcf('0x0'));var path=require(_0x9bcf('0x1'));var _=require(_0x9bcf('0x2'));var moment=require(_0x9bcf('0x3'));var CronJobManager=require(_0x9bcf('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x9bcf('0x5'));var logger=require(_0x9bcf('0x6'))(_0x9bcf('0x7'));var db=require(_0x9bcf('0x8'))['db'];var analyticCustomReportController=require(_0x9bcf('0x9'));var analyticDefaultReportController=require(_0x9bcf('0xa'));var client=jayson[_0x9bcf('0xb')][_0x9bcf('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x46e269,_0x37ee94){return function(){logger[_0x9bcf('0xd')](_0x9bcf('0xe'),_0x46e269[_0x9bcf('0xf')]);var _0x90760d=!![];var _0x55e8bd={'tls':{'rejectUnauthorized':![]}};if(_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x12')]){_0x55e8bd[_0x9bcf('0x12')]=_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')]['service'];}else{_0x55e8bd[_0x9bcf('0x13')]=_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x13')];_0x55e8bd[_0x9bcf('0x14')]=_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')]['port'];_0x55e8bd[_0x9bcf('0x15')]=_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x15')];}if(_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x16')]){_0x55e8bd['auth']={'user':_0x46e269['MailAccount'][_0x9bcf('0x11')]['user'],'pass':_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x17')]};}var _0x412c16={'account':_0x55e8bd,'message':{'from':util[_0x9bcf('0x18')]('\x22%s\x22\x20<%s>',_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x19')],_0x46e269['MailAccount']['email']||_0x46e269[_0x9bcf('0x10')][_0x9bcf('0x11')][_0x9bcf('0x1a')]),'to':_0x46e269['email'],'cc':_0x46e269['cc'],'bcc':_0x46e269['bcc'],'subject':util['format'](_0x9bcf('0x1b'),_0x37ee94[_0x9bcf('0x19')],_0x46e269[_0x9bcf('0x1c')],_0x46e269['subtractUnit'])}};var _0x33713d=path[_0x9bcf('0x1d')](__dirname,_0x9bcf('0x1e'));var _0x2934dc=_0x37ee94[_0x9bcf('0x1f')];var _0x2169bf=util[_0x9bcf('0x18')](_0x9bcf('0x20'),path[_0x9bcf('0x21')](_0x37ee94['savename'],path['extname'](_0x37ee94[_0x9bcf('0x1f')])),'zip');var _0x32fb2f=path[_0x9bcf('0x1d')](_0x33713d,_0x2934dc);var _0xf7608f=path[_0x9bcf('0x1d')](_0x33713d,_0x2169bf);if(fs['existsSync'](_0x32fb2f)){_0x37ee94[_0x9bcf('0x22')]=_0x9bcf('0x23');_0x412c16[_0x9bcf('0x24')][_0x9bcf('0x25')]=[{'filename':_0x2934dc,'path':_0x32fb2f}];_0x412c16['message'][_0x9bcf('0x26')]=util['format'](_0x9bcf('0x27'),JSON[_0x9bcf('0x28')](_0x37ee94,null,0x2));}else if(fs[_0x9bcf('0x29')](_0xf7608f)){_0x37ee94[_0x9bcf('0x22')]=_0x9bcf('0x23');_0x412c16[_0x9bcf('0x24')][_0x9bcf('0x25')]=[{'filename':_0x2169bf,'path':_0xf7608f}];}else{_0x412c16[_0x9bcf('0x24')][_0x9bcf('0x26')]=_0x9bcf('0x2a');if(!_0x46e269[_0x9bcf('0x2b')]){_0x90760d=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x90760d){return client[_0x9bcf('0x2c')](_0x9bcf('0x2d'),_0x412c16)['then'](function(_0x3294cb){if(_0x3294cb[_0x9bcf('0x2e')]){return logger[_0x9bcf('0x2e')](_0x9bcf('0x2f'),JSON['stringify'](_0x3294cb));}return logger[_0x9bcf('0xd')](_0x9bcf('0x30'));})[_0x9bcf('0x31')](function(_0xf6ff60){return logger[_0x9bcf('0x2e')](_0x9bcf('0x2f'),JSON[_0x9bcf('0x28')](_0xf6ff60));});}};}function handleError(){return function(_0x8df758){return logger[_0x9bcf('0x2e')](JSON[_0x9bcf('0x28')](_0x8df758));};}function handleResult(_0x4b602e){return function(_0x3731fb){logger[_0x9bcf('0xd')](_0x9bcf('0x32'),JSON[_0x9bcf('0x28')](_0x3731fb));if(_0x4b602e[_0x9bcf('0x10')]&&_0x4b602e[_0x9bcf('0x10')]['Smtp']&&!_['isNil'](_0x4b602e[_0x9bcf('0xf')])){setTimeout(handleSendEmail(_0x4b602e,_0x3731fb),0x3c*0x3e8);}};}function handleJob(_0x2bd5a1){return function(){try{if(_[_0x9bcf('0x33')](_0x2bd5a1[_0x9bcf('0x1c')])){return logger[_0x9bcf('0xd')](_0x9bcf('0x34'));}if(_[_0x9bcf('0x33')](_0x2bd5a1[_0x9bcf('0x35')])){return logger[_0x9bcf('0xd')](_0x9bcf('0x36'));}var _0x5250={'startDate':moment()['subtract'](_0x2bd5a1[_0x9bcf('0x1c')],_0x2bd5a1[_0x9bcf('0x35')])['format'](_0x9bcf('0x37')),'endDate':moment()[_0x9bcf('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x2bd5a1['output'],'name':_0x2bd5a1[_0x9bcf('0x19')]};if(!_['isNil'](_0x2bd5a1[_0x9bcf('0x38')])){logger[_0x9bcf('0xd')](_0x9bcf('0x39'),_0x2bd5a1[_0x9bcf('0x38')]);return analyticDefaultReportController[_0x9bcf('0x3a')]({'id':_0x2bd5a1[_0x9bcf('0x38')]},_0x5250)[_0x9bcf('0x3b')](handleResult(_0x2bd5a1))[_0x9bcf('0x31')](handleError());}if(!_['isNil'](_0x2bd5a1['CustomReportId'])){logger[_0x9bcf('0xd')](_0x9bcf('0x3c'),_0x2bd5a1[_0x9bcf('0x3d')]);return analyticCustomReportController[_0x9bcf('0x3a')]({'id':_0x2bd5a1[_0x9bcf('0x3d')]},_0x5250)[_0x9bcf('0x3b')](handleResult(_0x2bd5a1))[_0x9bcf('0x31')](handleError());}}catch(_0x605914){logger[_0x9bcf('0x2e')](JSON[_0x9bcf('0x28')](_0x605914));}return logger['info'](_0x9bcf('0x3e'));};}function getJobs(_0x4e6d0f){var _0x250dcb={};if(_0x4e6d0f){_0x250dcb['id']=_0x4e6d0f;}return db['Schedule'][_0x9bcf('0x3f')]({'where':_0x250dcb,'include':[{'model':db[_0x9bcf('0x10')],'attributes':['id',_0x9bcf('0x19'),_0x9bcf('0xf')],'include':[{'model':db[_0x9bcf('0x40')],'as':_0x9bcf('0x11')}]}]})[_0x9bcf('0x3b')](function(_0x41b384){var _0xadfa5d=_[_0x9bcf('0x41')](manager[_0x9bcf('0x42')]);var _0x5e57a4=_[_0x9bcf('0x43')](_0x41b384,function(_0x5e67c6){return _0x5e67c6['id'][_0x9bcf('0x44')]();});var _0x4b24ea=_[_0x9bcf('0x45')](_0x41b384,function(_0xed658c){return _0xed658c['id'][_0x9bcf('0x44')]();});var _0x74397e=_0x4e6d0f?_0x5e57a4:_[_0x9bcf('0x46')](_0x5e57a4,_0xadfa5d);var _0x1d4209=_[_0x9bcf('0x47')](_0x5e57a4,_0xadfa5d);var _0x4865f2=_[_0x9bcf('0x46')](_0xadfa5d,_0x5e57a4);var _0x4e2ea3;var _0x370802;for(_0x4e2ea3=0x0;_0x4e2ea3<_0x4865f2[_0x9bcf('0x48')]&&!_0x4e6d0f;_0x4e2ea3+=0x1){_0x370802=_0x4865f2[_0x4e2ea3][_0x9bcf('0x44')]();if(manager[_0x9bcf('0x49')](_0x370802)){manager[_0x9bcf('0x4a')](_0x370802);manager[_0x9bcf('0x4b')](_0x370802);logger['info'](_0x9bcf('0x4c'),_0x370802);}}logger[_0x9bcf('0xd')](_0x9bcf('0x4d'),JSON[_0x9bcf('0x28')](_0x74397e));for(_0x4e2ea3=0x0;_0x4e2ea3<_0x74397e['length'];_0x4e2ea3+=0x1){_0x370802=_0x74397e[_0x4e2ea3][_0x9bcf('0x44')]();logger[_0x9bcf('0xd')](_0x9bcf('0x4e'),_0x370802);if(_0x4e6d0f){logger[_0x9bcf('0xd')](_0x9bcf('0x4f'),_0x4e6d0f);logger[_0x9bcf('0xd')](JSON[_0x9bcf('0x28')](_0x4b24ea[_0x370802]));BPromise[_0x9bcf('0x50')]()[_0x9bcf('0x3b')](handleJob(_0x4b24ea[_0x370802]));logger[_0x9bcf('0xd')]('run\x20job',_0x4b24ea[_0x370802][_0x9bcf('0x19')],_0x4b24ea[_0x370802][_0x9bcf('0x51')]);}else if(_0x4b24ea[_0x370802][_0x9bcf('0x51')]&&_0x4b24ea[_0x370802][_0x9bcf('0x52')]&&moment()[_0x9bcf('0x53')](_0x4b24ea[_0x370802]['startAt'],_0x4b24ea[_0x370802][_0x9bcf('0x54')])){manager[_0x9bcf('0x55')](_0x370802,_0x4b24ea[_0x370802][_0x9bcf('0x51')],handleJob(_0x4b24ea[_0x370802]));manager['start'](_0x370802);logger[_0x9bcf('0xd')](_0x9bcf('0x56'),_0x4b24ea[_0x370802]['name'],_0x4b24ea[_0x370802][_0x9bcf('0x51')]);}else if(manager[_0x9bcf('0x49')](_0x370802)){manager[_0x9bcf('0x4a')](_0x370802);manager[_0x9bcf('0x4b')](_0x370802);logger[_0x9bcf('0xd')](_0x9bcf('0x57'),_0x4b24ea[_0x370802]['name'],_0x4b24ea[_0x370802]['cron']);}}for(_0x4e2ea3=0x0,_0x370802;_0x4e2ea3<_0x1d4209[_0x9bcf('0x48')]&&!_0x4e6d0f;_0x4e2ea3+=0x1){_0x370802=_0x1d4209[_0x4e2ea3][_0x9bcf('0x44')]();if(manager['exists'](_0x370802)){if(_0x4b24ea[_0x370802][_0x9bcf('0x51')]&&_0x4b24ea[_0x370802][_0x9bcf('0x52')]&&moment()[_0x9bcf('0x53')](_0x4b24ea[_0x370802][_0x9bcf('0x58')],_0x4b24ea[_0x370802][_0x9bcf('0x54')])){manager[_0x9bcf('0x59')](_0x370802,_0x4b24ea[_0x370802][_0x9bcf('0x51')],handleJob(_0x4b24ea[_0x370802]));logger[_0x9bcf('0xd')](_0x9bcf('0x5a'),_0x4b24ea[_0x370802]['name'],_0x4b24ea[_0x370802][_0x9bcf('0x51')]);}else{manager[_0x9bcf('0x4a')](_0x370802);manager[_0x9bcf('0x4b')](_0x370802);logger['info'](_0x9bcf('0x57'),_0x4b24ea[_0x370802][_0x9bcf('0x19')],_0x4b24ea[_0x370802][_0x9bcf('0x51')]);}}}})[_0x9bcf('0x31')](function(_0x4e7fb3){logger[_0x9bcf('0x2e')](JSON[_0x9bcf('0x28')](_0x4e7fb3));});}exports[_0x9bcf('0x5b')]=function(_0x462b52){return getJobs(_0x462b52);};exports[_0x9bcf('0x5c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file