Built motion from commit (unavailable).|2.5.19
[motion2.git] / server / config / schedule / index.js
index 03b06a7..87c7ac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf535=['index','resolve','cron','active','isBetween','startAt','add','start','add\x20cron','endAt','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','status','message','attachments','text','existsSync','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun'];(function(_0x31ceb6,_0xa29260){var _0x465000=function(_0x3b496d){while(--_0x3b496d){_0x31ceb6['push'](_0x31ceb6['shift']());}};_0x465000(++_0xa29260);}(_0xf535,0x6b));var _0x5f53=function(_0x432723,_0x31e971){_0x432723=_0x432723-0x0;var _0x4f4991=_0xf535[_0x432723];return _0x4f4991;};'use strict';var fs=require('fs');var util=require(_0x5f53('0x0'));var path=require(_0x5f53('0x1'));var _=require(_0x5f53('0x2'));var moment=require(_0x5f53('0x3'));var CronJobManager=require(_0x5f53('0x4'));var jayson=require(_0x5f53('0x5'));var BPromise=require(_0x5f53('0x6'));var logger=require(_0x5f53('0x7'))('schedule');var db=require(_0x5f53('0x8'))['db'];var analyticCustomReportController=require(_0x5f53('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x5f53('0xa')][_0x5f53('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x15546b,_0x481172){return function(){logger[_0x5f53('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x15546b['email']);var _0x29bd07=!![];var _0x325bdf={'tls':{'rejectUnauthorized':![]}};if(_0x15546b[_0x5f53('0xd')]['Smtp'][_0x5f53('0xe')]){_0x325bdf[_0x5f53('0xe')]=_0x15546b[_0x5f53('0xd')][_0x5f53('0xf')][_0x5f53('0xe')];}else{_0x325bdf[_0x5f53('0x10')]=_0x15546b[_0x5f53('0xd')][_0x5f53('0xf')][_0x5f53('0x10')];_0x325bdf[_0x5f53('0x11')]=_0x15546b[_0x5f53('0xd')][_0x5f53('0xf')][_0x5f53('0x11')];_0x325bdf[_0x5f53('0x12')]=_0x15546b[_0x5f53('0xd')]['Smtp'][_0x5f53('0x12')];}if(_0x15546b[_0x5f53('0xd')]['Smtp'][_0x5f53('0x13')]){_0x325bdf[_0x5f53('0x14')]={'user':_0x15546b[_0x5f53('0xd')][_0x5f53('0xf')]['user'],'pass':_0x15546b['MailAccount'][_0x5f53('0xf')][_0x5f53('0x15')]};}var _0x5c9f5c={'account':_0x325bdf,'message':{'from':util[_0x5f53('0x16')](_0x5f53('0x17'),_0x15546b[_0x5f53('0xd')][_0x5f53('0x18')],_0x15546b[_0x5f53('0xd')][_0x5f53('0x19')]||_0x15546b[_0x5f53('0xd')][_0x5f53('0xf')][_0x5f53('0x1a')]),'to':_0x15546b[_0x5f53('0x19')],'cc':_0x15546b['cc'],'bcc':_0x15546b[_0x5f53('0x1b')],'subject':util['format'](_0x5f53('0x1c'),_0x481172[_0x5f53('0x18')],_0x15546b[_0x5f53('0x1d')],_0x15546b[_0x5f53('0x1e')])}};var _0x15d28f=path[_0x5f53('0x1f')](__dirname,_0x5f53('0x20'));var _0x472a72=_0x481172[_0x5f53('0x21')];var _0xcf334=util[_0x5f53('0x16')](_0x5f53('0x22'),path[_0x5f53('0x23')](_0x481172[_0x5f53('0x21')],path['extname'](_0x481172[_0x5f53('0x21')])),_0x5f53('0x24'));var _0x5e9321=path['join'](_0x15d28f,_0x472a72);var _0x42ae85=path[_0x5f53('0x1f')](_0x15d28f,_0xcf334);if(fs['existsSync'](_0x5e9321)){_0x481172[_0x5f53('0x25')]='Sent';_0x5c9f5c[_0x5f53('0x26')][_0x5f53('0x27')]=[{'filename':_0x472a72,'path':_0x5e9321}];_0x5c9f5c[_0x5f53('0x26')][_0x5f53('0x28')]=util[_0x5f53('0x16')]('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'](_0x481172,null,0x2));}else if(fs[_0x5f53('0x29')](_0x42ae85)){_0x481172[_0x5f53('0x25')]=_0x5f53('0x2a');_0x5c9f5c['message']['attachments']=[{'filename':_0xcf334,'path':_0x42ae85}];}else{_0x5c9f5c[_0x5f53('0x26')]['text']=_0x5f53('0x2b');if(!_0x15546b['sendIfEmpty']){_0x29bd07=![];logger[_0x5f53('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x29bd07){return client[_0x5f53('0x2c')](_0x5f53('0x2d'),_0x5c9f5c)['then'](function(_0x5ba95e){if(_0x5ba95e['error']){return logger[_0x5f53('0x2e')](_0x5f53('0x2f'),JSON[_0x5f53('0x30')](_0x5ba95e));}return logger[_0x5f53('0xc')](_0x5f53('0x31'));})[_0x5f53('0x32')](function(_0x54fef7){return logger[_0x5f53('0x2e')]('error\x20mail',JSON['stringify'](_0x54fef7));});}};}function handleError(){return function(_0x4c407d){return logger[_0x5f53('0x2e')](JSON['stringify'](_0x4c407d));};}function handleResult(_0xa9c087){return function(_0x3b25bd){logger[_0x5f53('0xc')](_0x5f53('0x33'),JSON[_0x5f53('0x30')](_0x3b25bd));if(_0xa9c087[_0x5f53('0xd')]&&_0xa9c087['MailAccount']['Smtp']&&!_[_0x5f53('0x34')](_0xa9c087[_0x5f53('0x19')])){setTimeout(handleSendEmail(_0xa9c087,_0x3b25bd),0x3c*0x3e8);}};}function handleJob(_0x4bbab2){return function(){try{if(_['isNil'](_0x4bbab2[_0x5f53('0x1d')])){return logger[_0x5f53('0xc')](_0x5f53('0x35'));}if(_['isNil'](_0x4bbab2[_0x5f53('0x1e')])){return logger[_0x5f53('0xc')](_0x5f53('0x36'));}var _0xb9ef9b={'startDate':moment()[_0x5f53('0x37')](_0x4bbab2['subtractNumber'],_0x4bbab2[_0x5f53('0x1e')])[_0x5f53('0x16')](_0x5f53('0x38')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5f53('0x39'),'output':_0x4bbab2[_0x5f53('0x3a')],'name':_0x4bbab2[_0x5f53('0x18')]};if(!_[_0x5f53('0x34')](_0x4bbab2[_0x5f53('0x3b')])){logger[_0x5f53('0xc')](_0x5f53('0x3c'),_0x4bbab2[_0x5f53('0x3b')]);return analyticDefaultReportController[_0x5f53('0x3d')]({'id':_0x4bbab2[_0x5f53('0x3b')]},_0xb9ef9b)[_0x5f53('0x3e')](handleResult(_0x4bbab2))['catch'](handleError());}if(!_[_0x5f53('0x34')](_0x4bbab2[_0x5f53('0x3f')])){logger['info'](_0x5f53('0x40'),_0x4bbab2['CustomReportId']);return analyticCustomReportController[_0x5f53('0x3d')]({'id':_0x4bbab2[_0x5f53('0x3f')]},_0xb9ef9b)[_0x5f53('0x3e')](handleResult(_0x4bbab2))[_0x5f53('0x32')](handleError());}}catch(_0x5c794d){logger['error'](JSON[_0x5f53('0x30')](_0x5c794d));}return logger[_0x5f53('0xc')]('no\x20report\x20id');};}function getJobs(_0xb7119a){var _0x4128ea={};if(_0xb7119a){_0x4128ea['id']=_0xb7119a;}return db[_0x5f53('0x41')]['findAll']({'where':_0x4128ea,'include':[{'model':db[_0x5f53('0xd')],'attributes':['id',_0x5f53('0x18'),_0x5f53('0x19')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x5f53('0x3e')](function(_0x5ab74a){var _0x372379=_[_0x5f53('0x42')](manager[_0x5f53('0x43')]);var _0x392824=_[_0x5f53('0x44')](_0x5ab74a,function(_0x55fd96){return _0x55fd96['id'][_0x5f53('0x45')]();});var _0x2041b0=_[_0x5f53('0x46')](_0x5ab74a,function(_0xc7137){return _0xc7137['id'][_0x5f53('0x45')]();});var _0x3c6f93=_0xb7119a?_0x392824:_[_0x5f53('0x47')](_0x392824,_0x372379);var _0x38c82b=_[_0x5f53('0x48')](_0x392824,_0x372379);var _0x110211=_[_0x5f53('0x47')](_0x372379,_0x392824);var _0xd4b7ca;var _0x256d69;for(_0xd4b7ca=0x0;_0xd4b7ca<_0x110211[_0x5f53('0x49')]&&!_0xb7119a;_0xd4b7ca+=0x1){_0x256d69=_0x110211[_0xd4b7ca]['toString']();if(manager[_0x5f53('0x4a')](_0x256d69)){manager[_0x5f53('0x4b')](_0x256d69);manager[_0x5f53('0x4c')](_0x256d69);logger[_0x5f53('0xc')](_0x5f53('0x4d'),_0x256d69);}}logger[_0x5f53('0xc')](_0x5f53('0x4e'),JSON['stringify'](_0x3c6f93));for(_0xd4b7ca=0x0;_0xd4b7ca<_0x3c6f93[_0x5f53('0x49')];_0xd4b7ca+=0x1){_0x256d69=_0x3c6f93[_0xd4b7ca][_0x5f53('0x45')]();logger[_0x5f53('0xc')](_0x5f53('0x4f'),_0x256d69);if(_0xb7119a){logger[_0x5f53('0xc')]('my\x20id',_0xb7119a);logger['info'](JSON[_0x5f53('0x30')](_0x2041b0[_0x256d69]));BPromise[_0x5f53('0x50')]()[_0x5f53('0x3e')](handleJob(_0x2041b0[_0x256d69]));logger[_0x5f53('0xc')]('run\x20job',_0x2041b0[_0x256d69][_0x5f53('0x18')],_0x2041b0[_0x256d69]['cron']);}else if(_0x2041b0[_0x256d69][_0x5f53('0x51')]&&_0x2041b0[_0x256d69][_0x5f53('0x52')]&&moment()[_0x5f53('0x53')](_0x2041b0[_0x256d69][_0x5f53('0x54')],_0x2041b0[_0x256d69]['endAt'])){manager[_0x5f53('0x55')](_0x256d69,_0x2041b0[_0x256d69][_0x5f53('0x51')],handleJob(_0x2041b0[_0x256d69]));manager[_0x5f53('0x56')](_0x256d69);logger['info'](_0x5f53('0x57'),_0x2041b0[_0x256d69][_0x5f53('0x18')],_0x2041b0[_0x256d69][_0x5f53('0x51')]);}else if(manager[_0x5f53('0x4a')](_0x256d69)){manager[_0x5f53('0x4b')](_0x256d69);manager[_0x5f53('0x4c')](_0x256d69);logger['info']('stop\x20cron',_0x2041b0[_0x256d69]['name'],_0x2041b0[_0x256d69]['cron']);}}for(_0xd4b7ca=0x0,_0x256d69;_0xd4b7ca<_0x38c82b[_0x5f53('0x49')]&&!_0xb7119a;_0xd4b7ca+=0x1){_0x256d69=_0x38c82b[_0xd4b7ca][_0x5f53('0x45')]();if(manager[_0x5f53('0x4a')](_0x256d69)){if(_0x2041b0[_0x256d69][_0x5f53('0x51')]&&_0x2041b0[_0x256d69][_0x5f53('0x52')]&&moment()[_0x5f53('0x53')](_0x2041b0[_0x256d69][_0x5f53('0x54')],_0x2041b0[_0x256d69][_0x5f53('0x58')])){manager[_0x5f53('0x59')](_0x256d69,_0x2041b0[_0x256d69][_0x5f53('0x51')],handleJob(_0x2041b0[_0x256d69]));logger[_0x5f53('0xc')](_0x5f53('0x5a'),_0x2041b0[_0x256d69][_0x5f53('0x18')],_0x2041b0[_0x256d69]['cron']);}else{manager['stop'](_0x256d69);manager[_0x5f53('0x4c')](_0x256d69);logger[_0x5f53('0xc')](_0x5f53('0x5b'),_0x2041b0[_0x256d69][_0x5f53('0x18')],_0x2041b0[_0x256d69][_0x5f53('0x51')]);}}}})[_0x5f53('0x32')](function(_0xf5222b){logger['error'](JSON['stringify'](_0xf5222b));});}exports[_0x5f53('0x5c')]=function(_0x2858cf){return getJobs(_0x2858cf);};exports[_0x5f53('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+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