Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / config / schedule / index.js
index adbf5a1..a5f8c8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f47=['map','toString','difference','stop','delete\x20cron','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','exists','deleteJob','stop\x20cron','length','update','update\x20cron','start','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','MailAccount','getSmtpOptions','format','name','user','subtractNumber','subtractUnit','../../files/reports','basename','extname','savename','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','error','error\x20mail','stringify','email\x20sent','data','Smtp','subtractNumber\x20null\x20or\x20undefined','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','catch','no\x20report\x20id','Schedule','findAll','MailServerOut'];(function(_0x1f09bb,_0x1dd71c){var _0x45d669=function(_0x2e34c3){while(--_0x2e34c3){_0x1f09bb['push'](_0x1f09bb['shift']());}};_0x45d669(++_0x1dd71c);}(_0x9f47,0x1e9));var _0x79f4=function(_0x18eeee,_0x34e6c2){_0x18eeee=_0x18eeee-0x0;var _0x509668=_0x9f47[_0x18eeee];return _0x509668;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x79f4('0x0'));var moment=require(_0x79f4('0x1'));var CronJobManager=require(_0x79f4('0x2'));var jayson=require(_0x79f4('0x3'));var BPromise=require(_0x79f4('0x4'));var logger=require('../logger')('schedule');var db=require(_0x79f4('0x5'))['db'];var analyticCustomReportController=require(_0x79f4('0x6'));var analyticDefaultReportController=require(_0x79f4('0x7'));var client=jayson['client'][_0x79f4('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f787f,_0x5db4c5){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x2f787f[_0x79f4('0x9')]);var _0x1cf7ee=!![];var _0xee1c7b=_0x2f787f[_0x79f4('0xa')][_0x79f4('0xb')]();var _0x364115={'account':_0xee1c7b,'message':{'from':util[_0x79f4('0xc')]('\x22%s\x22\x20<%s>',_0x2f787f['MailAccount'][_0x79f4('0xd')],_0x2f787f[_0x79f4('0xa')][_0x79f4('0x9')]||_0x2f787f[_0x79f4('0xa')]['Smtp'][_0x79f4('0xe')]),'to':_0x2f787f[_0x79f4('0x9')],'cc':_0x2f787f['cc'],'bcc':_0x2f787f['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x5db4c5['name'],_0x2f787f[_0x79f4('0xf')],_0x2f787f[_0x79f4('0x10')])}};var _0x4836a1=path['join'](__dirname,_0x79f4('0x11'));var _0x140bf8=_0x5db4c5['savename'];var _0x39ad25=util[_0x79f4('0xc')]('%s.%s',path[_0x79f4('0x12')](_0x5db4c5['savename'],path[_0x79f4('0x13')](_0x5db4c5[_0x79f4('0x14')])),'zip');var _0x17cfcd=path['join'](_0x4836a1,_0x140bf8);var _0x387819=path[_0x79f4('0x15')](_0x4836a1,_0x39ad25);if(fs[_0x79f4('0x16')](_0x17cfcd)){_0x5db4c5[_0x79f4('0x17')]=_0x79f4('0x18');_0x364115[_0x79f4('0x19')][_0x79f4('0x1a')]=[{'filename':_0x140bf8,'path':_0x17cfcd}];_0x364115[_0x79f4('0x19')][_0x79f4('0x1b')]=util[_0x79f4('0xc')](_0x79f4('0x1c'),JSON['stringify'](_0x5db4c5,null,0x2));}else if(fs[_0x79f4('0x16')](_0x387819)){_0x5db4c5[_0x79f4('0x17')]=_0x79f4('0x18');_0x364115[_0x79f4('0x19')][_0x79f4('0x1a')]=[{'filename':_0x39ad25,'path':_0x387819}];}else{_0x364115[_0x79f4('0x19')][_0x79f4('0x1b')]=_0x79f4('0x1d');if(!_0x2f787f[_0x79f4('0x1e')]){_0x1cf7ee=![];logger[_0x79f4('0x1f')](_0x79f4('0x20'));}}if(_0x1cf7ee){return client[_0x79f4('0x21')](_0x79f4('0x22'),_0x364115)['then'](function(_0x1f3807){if(_0x1f3807[_0x79f4('0x23')]){return logger['error'](_0x79f4('0x24'),JSON[_0x79f4('0x25')](_0x1f3807));}return logger[_0x79f4('0x1f')](_0x79f4('0x26'));})['catch'](function(_0x41cb04){return logger[_0x79f4('0x23')](_0x79f4('0x24'),JSON['stringify'](_0x41cb04));});}};}function handleError(){return function(_0x3f8496){return logger['error'](JSON['stringify'](_0x3f8496));};}function handleResult(_0x3cdd92){return function(_0x292c6c){logger['info'](_0x79f4('0x27'),JSON[_0x79f4('0x25')](_0x292c6c));if(_0x3cdd92['MailAccount']&&_0x3cdd92[_0x79f4('0xa')][_0x79f4('0x28')]&&!_['isNil'](_0x3cdd92['email'])){setTimeout(handleSendEmail(_0x3cdd92,_0x292c6c),0x3c*0x3e8);}};}function handleJob(_0x276a2b){return function(){try{if(_['isNil'](_0x276a2b[_0x79f4('0xf')])){return logger['info'](_0x79f4('0x29'));}if(_[_0x79f4('0x2a')](_0x276a2b[_0x79f4('0x10')])){return logger[_0x79f4('0x1f')]('subtractUnit\x20null\x20or\x20undefined');}var _0x468df0={'startDate':moment()[_0x79f4('0x2b')](_0x276a2b[_0x79f4('0xf')],_0x276a2b[_0x79f4('0x10')])['format'](_0x79f4('0x2c')),'endDate':moment()[_0x79f4('0xc')](_0x79f4('0x2c')),'type':'scheduled','output':_0x276a2b[_0x79f4('0x2d')],'name':_0x276a2b['name']};if(!_[_0x79f4('0x2a')](_0x276a2b['DefaultReportId'])){logger[_0x79f4('0x1f')](_0x79f4('0x2e'),_0x276a2b['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x276a2b[_0x79f4('0x2f')]},_0x468df0)[_0x79f4('0x30')](handleResult(_0x276a2b))['catch'](handleError());}if(!_[_0x79f4('0x2a')](_0x276a2b[_0x79f4('0x31')])){logger[_0x79f4('0x1f')](_0x79f4('0x32'),_0x276a2b[_0x79f4('0x31')]);return analyticCustomReportController[_0x79f4('0x33')]({'id':_0x276a2b[_0x79f4('0x31')]},_0x468df0)[_0x79f4('0x30')](handleResult(_0x276a2b))[_0x79f4('0x34')](handleError());}}catch(_0x27c21e){logger[_0x79f4('0x23')](JSON[_0x79f4('0x25')](_0x27c21e));}return logger['info'](_0x79f4('0x35'));};}function getJobs(_0x1edf62){var _0x536d88={};if(_0x1edf62){_0x536d88['id']=_0x1edf62;}return db[_0x79f4('0x36')][_0x79f4('0x37')]({'where':_0x536d88,'include':[{'model':db[_0x79f4('0xa')],'attributes':['id',_0x79f4('0xd'),_0x79f4('0x9')],'include':[{'model':db[_0x79f4('0x38')],'as':_0x79f4('0x28'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x79f4('0x30')](function(_0x3bd087){var _0xef3b71=_['keys'](manager['jobs']);var _0x13edca=_[_0x79f4('0x39')](_0x3bd087,function(_0x41db6a){return _0x41db6a['id'][_0x79f4('0x3a')]();});var _0xf22a1b=_['keyBy'](_0x3bd087,function(_0x6a7961){return _0x6a7961['id'][_0x79f4('0x3a')]();});var _0x99d35b=_0x1edf62?_0x13edca:_[_0x79f4('0x3b')](_0x13edca,_0xef3b71);var _0x6f9e22=_['intersection'](_0x13edca,_0xef3b71);var _0x3a5c47=_['difference'](_0xef3b71,_0x13edca);var _0x55a383;var _0x2b5061;for(_0x55a383=0x0;_0x55a383<_0x3a5c47['length']&&!_0x1edf62;_0x55a383+=0x1){_0x2b5061=_0x3a5c47[_0x55a383][_0x79f4('0x3a')]();if(manager['exists'](_0x2b5061)){manager[_0x79f4('0x3c')](_0x2b5061);manager['deleteJob'](_0x2b5061);logger['info'](_0x79f4('0x3d'),_0x2b5061);}}logger['info']('toRun',JSON[_0x79f4('0x25')](_0x99d35b));for(_0x55a383=0x0;_0x55a383<_0x99d35b['length'];_0x55a383+=0x1){_0x2b5061=_0x99d35b[_0x55a383][_0x79f4('0x3a')]();logger[_0x79f4('0x1f')](_0x79f4('0x3e'),_0x2b5061);if(_0x1edf62){logger[_0x79f4('0x1f')]('my\x20id',_0x1edf62);logger[_0x79f4('0x1f')](JSON[_0x79f4('0x25')](_0xf22a1b[_0x2b5061]));BPromise[_0x79f4('0x3f')]()[_0x79f4('0x30')](handleJob(_0xf22a1b[_0x2b5061]));logger[_0x79f4('0x1f')](_0x79f4('0x40'),_0xf22a1b[_0x2b5061][_0x79f4('0xd')],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else if(_0xf22a1b[_0x2b5061][_0x79f4('0x41')]&&_0xf22a1b[_0x2b5061][_0x79f4('0x42')]&&moment()[_0x79f4('0x43')](_0xf22a1b[_0x2b5061][_0x79f4('0x44')],_0xf22a1b[_0x2b5061][_0x79f4('0x45')])){manager[_0x79f4('0x46')](_0x2b5061,_0xf22a1b[_0x2b5061][_0x79f4('0x41')],handleJob(_0xf22a1b[_0x2b5061]));manager['start'](_0x2b5061);logger[_0x79f4('0x1f')]('add\x20cron',_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else if(manager[_0x79f4('0x47')](_0x2b5061)){manager[_0x79f4('0x3c')](_0x2b5061);manager[_0x79f4('0x48')](_0x2b5061);logger[_0x79f4('0x1f')](_0x79f4('0x49'),_0xf22a1b[_0x2b5061][_0x79f4('0xd')],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}}for(_0x55a383=0x0,_0x2b5061;_0x55a383<_0x6f9e22[_0x79f4('0x4a')]&&!_0x1edf62;_0x55a383+=0x1){_0x2b5061=_0x6f9e22[_0x55a383][_0x79f4('0x3a')]();if(manager[_0x79f4('0x47')](_0x2b5061)){if(_0xf22a1b[_0x2b5061][_0x79f4('0x41')]&&_0xf22a1b[_0x2b5061]['active']&&moment()[_0x79f4('0x43')](_0xf22a1b[_0x2b5061][_0x79f4('0x44')],_0xf22a1b[_0x2b5061][_0x79f4('0x45')])){manager[_0x79f4('0x4b')](_0x2b5061,_0xf22a1b[_0x2b5061][_0x79f4('0x41')],handleJob(_0xf22a1b[_0x2b5061]));logger[_0x79f4('0x1f')](_0x79f4('0x4c'),_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}else{manager['stop'](_0x2b5061);manager['deleteJob'](_0x2b5061);logger['info'](_0x79f4('0x49'),_0xf22a1b[_0x2b5061]['name'],_0xf22a1b[_0x2b5061][_0x79f4('0x41')]);}}}})[_0x79f4('0x34')](function(_0x394b70){logger[_0x79f4('0x23')](JSON[_0x79f4('0x25')](_0x394b70));});}exports['run']=function(_0x530054){return getJobs(_0x530054);};exports[_0x79f4('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xd8fb=['stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','intersection','difference','length','exists','stop','delete\x20cron','toRun','my\x20id','cron','active','endAt','add','start','stop\x20cron','startAt','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','bcc','subtractUnit','join','../../files/reports','%s.%s','basename','savename','zip','existsSync','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(_0x4321c4,_0x38b122){var _0x94f3f6=function(_0x23eca5){while(--_0x23eca5){_0x4321c4['push'](_0x4321c4['shift']());}};_0x94f3f6(++_0x38b122);}(_0xd8fb,0x8c));var _0xbd8f=function(_0x1642d8,_0x3a4f72){_0x1642d8=_0x1642d8-0x0;var _0x1d09d5=_0xd8fb[_0x1642d8];return _0x1d09d5;};'use strict';var fs=require('fs');var util=require(_0xbd8f('0x0'));var path=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));var moment=require(_0xbd8f('0x3'));var CronJobManager=require(_0xbd8f('0x4'));var jayson=require(_0xbd8f('0x5'));var BPromise=require('bluebird');var logger=require(_0xbd8f('0x6'))('schedule');var db=require(_0xbd8f('0x7'))['db'];var analyticCustomReportController=require(_0xbd8f('0x8'));var analyticDefaultReportController=require(_0xbd8f('0x9'));var client=jayson[_0xbd8f('0xa')][_0xbd8f('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x316b59,_0x3c9c8d){return function(){logger[_0xbd8f('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x316b59[_0xbd8f('0xd')]);var _0x45fe23=!![];var _0x56a318=_0x316b59['MailAccount'][_0xbd8f('0xe')]();var _0x2f8763={'account':_0x56a318,'message':{'from':util[_0xbd8f('0xf')](_0xbd8f('0x10'),_0x316b59[_0xbd8f('0x11')]['name'],_0x316b59[_0xbd8f('0x11')][_0xbd8f('0xd')]||_0x316b59[_0xbd8f('0x11')][_0xbd8f('0x12')][_0xbd8f('0x13')]),'to':_0x316b59[_0xbd8f('0xd')],'cc':_0x316b59['cc'],'bcc':_0x316b59[_0xbd8f('0x14')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x3c9c8d['name'],_0x316b59['subtractNumber'],_0x316b59[_0xbd8f('0x15')])}};var _0x57a9ed=path[_0xbd8f('0x16')](__dirname,_0xbd8f('0x17'));var _0x26fc30=_0x3c9c8d['savename'];var _0x3d6421=util['format'](_0xbd8f('0x18'),path[_0xbd8f('0x19')](_0x3c9c8d[_0xbd8f('0x1a')],path['extname'](_0x3c9c8d[_0xbd8f('0x1a')])),_0xbd8f('0x1b'));var _0x380ca8=path['join'](_0x57a9ed,_0x26fc30);var _0xb7f4be=path['join'](_0x57a9ed,_0x3d6421);if(fs[_0xbd8f('0x1c')](_0x380ca8)){_0x3c9c8d['status']=_0xbd8f('0x1d');_0x2f8763[_0xbd8f('0x1e')][_0xbd8f('0x1f')]=[{'filename':_0x26fc30,'path':_0x380ca8}];_0x2f8763[_0xbd8f('0x1e')][_0xbd8f('0x20')]=util['format'](_0xbd8f('0x21'),JSON[_0xbd8f('0x22')](_0x3c9c8d,null,0x2));}else if(fs[_0xbd8f('0x1c')](_0xb7f4be)){_0x3c9c8d[_0xbd8f('0x23')]=_0xbd8f('0x1d');_0x2f8763['message'][_0xbd8f('0x1f')]=[{'filename':_0x3d6421,'path':_0xb7f4be}];}else{_0x2f8763[_0xbd8f('0x1e')]['text']=_0xbd8f('0x24');if(!_0x316b59[_0xbd8f('0x25')]){_0x45fe23=![];logger['info'](_0xbd8f('0x26'));}}if(_0x45fe23){return client[_0xbd8f('0x27')](_0xbd8f('0x28'),_0x2f8763)[_0xbd8f('0x29')](function(_0x3bb11f){if(_0x3bb11f[_0xbd8f('0x2a')]){return logger['error']('error\x20mail',JSON[_0xbd8f('0x22')](_0x3bb11f));}return logger[_0xbd8f('0xc')]('email\x20sent');})[_0xbd8f('0x2b')](function(_0x30cbeb){return logger['error'](_0xbd8f('0x2c'),JSON[_0xbd8f('0x22')](_0x30cbeb));});}};}function handleError(){return function(_0x2432e3){return logger[_0xbd8f('0x2a')](JSON[_0xbd8f('0x22')](_0x2432e3));};}function handleResult(_0x481d74){return function(_0x19c8a5){logger[_0xbd8f('0xc')](_0xbd8f('0x2d'),JSON[_0xbd8f('0x22')](_0x19c8a5));if(_0x481d74[_0xbd8f('0x11')]&&_0x481d74[_0xbd8f('0x11')]['Smtp']&&!_[_0xbd8f('0x2e')](_0x481d74[_0xbd8f('0xd')])){setTimeout(handleSendEmail(_0x481d74,_0x19c8a5),0x3c*0x3e8);}};}function handleJob(_0x3c6d3a){return function(){try{if(_[_0xbd8f('0x2e')](_0x3c6d3a[_0xbd8f('0x2f')])){return logger[_0xbd8f('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xbd8f('0x2e')](_0x3c6d3a[_0xbd8f('0x15')])){return logger[_0xbd8f('0xc')](_0xbd8f('0x30'));}var _0x608b38={'startDate':moment()[_0xbd8f('0x31')](_0x3c6d3a[_0xbd8f('0x2f')],_0x3c6d3a[_0xbd8f('0x15')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0xbd8f('0x32')),'type':_0xbd8f('0x33'),'output':_0x3c6d3a[_0xbd8f('0x34')],'name':_0x3c6d3a[_0xbd8f('0x35')]};if(!_[_0xbd8f('0x2e')](_0x3c6d3a[_0xbd8f('0x36')])){logger[_0xbd8f('0xc')](_0xbd8f('0x37'),_0x3c6d3a[_0xbd8f('0x36')]);return analyticDefaultReportController[_0xbd8f('0x38')]({'id':_0x3c6d3a[_0xbd8f('0x36')]},_0x608b38)[_0xbd8f('0x29')](handleResult(_0x3c6d3a))[_0xbd8f('0x2b')](handleError());}if(!_[_0xbd8f('0x2e')](_0x3c6d3a['CustomReportId'])){logger[_0xbd8f('0xc')](_0xbd8f('0x39'),_0x3c6d3a[_0xbd8f('0x3a')]);return analyticCustomReportController[_0xbd8f('0x38')]({'id':_0x3c6d3a[_0xbd8f('0x3a')]},_0x608b38)[_0xbd8f('0x29')](handleResult(_0x3c6d3a))[_0xbd8f('0x2b')](handleError());}}catch(_0x3863ca){logger[_0xbd8f('0x2a')](JSON[_0xbd8f('0x22')](_0x3863ca));}return logger[_0xbd8f('0xc')](_0xbd8f('0x3b'));};}function getJobs(_0x57d6f7){var _0x555507={};if(_0x57d6f7){_0x555507['id']=_0x57d6f7;}return db[_0xbd8f('0x3c')][_0xbd8f('0x3d')]({'where':_0x555507,'include':[{'model':db[_0xbd8f('0x11')],'attributes':['id',_0xbd8f('0x35'),_0xbd8f('0xd')],'include':[{'model':db[_0xbd8f('0x3e')],'as':_0xbd8f('0x12'),'include':[{'model':db[_0xbd8f('0x3f')],'as':_0xbd8f('0x3f')}]}]}]})[_0xbd8f('0x29')](function(_0x48cd3c){var _0x566134=_[_0xbd8f('0x40')](manager[_0xbd8f('0x41')]);var _0x1c0eab=_[_0xbd8f('0x42')](_0x48cd3c,function(_0x336979){return _0x336979['id'][_0xbd8f('0x43')]();});var _0x119496=_[_0xbd8f('0x44')](_0x48cd3c,function(_0x2f1076){return _0x2f1076['id'][_0xbd8f('0x43')]();});var _0x1c57f7=_0x57d6f7?_0x1c0eab:_['difference'](_0x1c0eab,_0x566134);var _0x1c30ee=_[_0xbd8f('0x45')](_0x1c0eab,_0x566134);var _0x2c7c9a=_[_0xbd8f('0x46')](_0x566134,_0x1c0eab);var _0x474d5b;var _0x29baff;for(_0x474d5b=0x0;_0x474d5b<_0x2c7c9a[_0xbd8f('0x47')]&&!_0x57d6f7;_0x474d5b+=0x1){_0x29baff=_0x2c7c9a[_0x474d5b][_0xbd8f('0x43')]();if(manager[_0xbd8f('0x48')](_0x29baff)){manager[_0xbd8f('0x49')](_0x29baff);manager['deleteJob'](_0x29baff);logger[_0xbd8f('0xc')](_0xbd8f('0x4a'),_0x29baff);}}logger[_0xbd8f('0xc')](_0xbd8f('0x4b'),JSON[_0xbd8f('0x22')](_0x1c57f7));for(_0x474d5b=0x0;_0x474d5b<_0x1c57f7[_0xbd8f('0x47')];_0x474d5b+=0x1){_0x29baff=_0x1c57f7[_0x474d5b]['toString']();logger['info']('index',_0x29baff);if(_0x57d6f7){logger[_0xbd8f('0xc')](_0xbd8f('0x4c'),_0x57d6f7);logger[_0xbd8f('0xc')](JSON[_0xbd8f('0x22')](_0x119496[_0x29baff]));BPromise['resolve']()[_0xbd8f('0x29')](handleJob(_0x119496[_0x29baff]));logger[_0xbd8f('0xc')]('run\x20job',_0x119496[_0x29baff][_0xbd8f('0x35')],_0x119496[_0x29baff][_0xbd8f('0x4d')]);}else if(_0x119496[_0x29baff][_0xbd8f('0x4d')]&&_0x119496[_0x29baff][_0xbd8f('0x4e')]&&moment()['isBetween'](_0x119496[_0x29baff]['startAt'],_0x119496[_0x29baff][_0xbd8f('0x4f')])){manager[_0xbd8f('0x50')](_0x29baff,_0x119496[_0x29baff][_0xbd8f('0x4d')],handleJob(_0x119496[_0x29baff]));manager[_0xbd8f('0x51')](_0x29baff);logger[_0xbd8f('0xc')]('add\x20cron',_0x119496[_0x29baff][_0xbd8f('0x35')],_0x119496[_0x29baff]['cron']);}else if(manager[_0xbd8f('0x48')](_0x29baff)){manager['stop'](_0x29baff);manager['deleteJob'](_0x29baff);logger[_0xbd8f('0xc')](_0xbd8f('0x52'),_0x119496[_0x29baff][_0xbd8f('0x35')],_0x119496[_0x29baff][_0xbd8f('0x4d')]);}}for(_0x474d5b=0x0,_0x29baff;_0x474d5b<_0x1c30ee[_0xbd8f('0x47')]&&!_0x57d6f7;_0x474d5b+=0x1){_0x29baff=_0x1c30ee[_0x474d5b][_0xbd8f('0x43')]();if(manager[_0xbd8f('0x48')](_0x29baff)){if(_0x119496[_0x29baff][_0xbd8f('0x4d')]&&_0x119496[_0x29baff][_0xbd8f('0x4e')]&&moment()['isBetween'](_0x119496[_0x29baff][_0xbd8f('0x53')],_0x119496[_0x29baff][_0xbd8f('0x4f')])){manager[_0xbd8f('0x54')](_0x29baff,_0x119496[_0x29baff][_0xbd8f('0x4d')],handleJob(_0x119496[_0x29baff]));logger[_0xbd8f('0xc')](_0xbd8f('0x55'),_0x119496[_0x29baff][_0xbd8f('0x35')],_0x119496[_0x29baff][_0xbd8f('0x4d')]);}else{manager[_0xbd8f('0x49')](_0x29baff);manager['deleteJob'](_0x29baff);logger[_0xbd8f('0xc')](_0xbd8f('0x52'),_0x119496[_0x29baff][_0xbd8f('0x35')],_0x119496[_0x29baff]['cron']);}}}})[_0xbd8f('0x2b')](function(_0x1ded6d){logger[_0xbd8f('0x2a')](JSON[_0xbd8f('0x22')](_0x1ded6d));});}exports[_0xbd8f('0x56')]=function(_0x50a8af){return getJobs(_0x50a8af);};exports[_0xbd8f('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file