Built motion from commit 14588770.|2.5.38
[motion2.git] / server / config / schedule / index.js
index 72caa73..4a1f79a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f84=['auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','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','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','difference','deleteJob','delete\x20cron','length','my\x20id','run\x20job','isBetween','startAt','endAt','cron','exists','stop','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','service','MailAccount','host','Smtp','port','secure','authentication'];(function(_0x1dc9a1,_0x1b65f0){var _0x25bbdb=function(_0x1a0d51){while(--_0x1a0d51){_0x1dc9a1['push'](_0x1dc9a1['shift']());}};_0x25bbdb(++_0x1b65f0);}(_0x6f84,0x1b2));var _0x46f8=function(_0x393a3a,_0x40220c){_0x393a3a=_0x393a3a-0x0;var _0x1b4631=_0x6f84[_0x393a3a];return _0x1b4631;};'use strict';var fs=require('fs');var util=require(_0x46f8('0x0'));var path=require(_0x46f8('0x1'));var _=require('lodash');var moment=require(_0x46f8('0x2'));var CronJobManager=require(_0x46f8('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x46f8('0x4'));var logger=require(_0x46f8('0x5'))(_0x46f8('0x6'));var db=require(_0x46f8('0x7'))['db'];var analyticCustomReportController=require(_0x46f8('0x8'));var analyticDefaultReportController=require(_0x46f8('0x9'));var client=jayson[_0x46f8('0xa')][_0x46f8('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x39a34f,_0x122833){return function(){logger[_0x46f8('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x39a34f[_0x46f8('0xd')]);var _0x53b9bc=!![];var _0x1d6673={'tls':{'rejectUnauthorized':![]}};if(_0x39a34f['MailAccount']['Smtp'][_0x46f8('0xe')]){_0x1d6673['service']=_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0xe')];}else{_0x1d6673[_0x46f8('0x10')]=_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x10')];_0x1d6673[_0x46f8('0x12')]=_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0x12')];_0x1d6673[_0x46f8('0x13')]=_0x39a34f[_0x46f8('0xf')]['Smtp']['secure'];}if(_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0x14')]){_0x1d6673[_0x46f8('0x15')]={'user':_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x16')],'pass':_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x17')]};}var _0x4136c8={'account':_0x1d6673,'message':{'from':util[_0x46f8('0x18')](_0x46f8('0x19'),_0x39a34f[_0x46f8('0xf')][_0x46f8('0x1a')],_0x39a34f[_0x46f8('0xf')][_0x46f8('0xd')]||_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x16')]),'to':_0x39a34f[_0x46f8('0xd')],'cc':_0x39a34f['cc'],'bcc':_0x39a34f[_0x46f8('0x1b')],'subject':util[_0x46f8('0x18')](_0x46f8('0x1c'),_0x122833[_0x46f8('0x1a')],_0x39a34f['subtractNumber'],_0x39a34f[_0x46f8('0x1d')])}};var _0x5abb01=path[_0x46f8('0x1e')](__dirname,_0x46f8('0x1f'));var _0xa95bbf=_0x122833[_0x46f8('0x20')];var _0x224f03=util['format'](_0x46f8('0x21'),path[_0x46f8('0x22')](_0x122833['savename'],path[_0x46f8('0x23')](_0x122833['savename'])),_0x46f8('0x24'));var _0x3a06b8=path[_0x46f8('0x1e')](_0x5abb01,_0xa95bbf);var _0x333d89=path[_0x46f8('0x1e')](_0x5abb01,_0x224f03);if(fs[_0x46f8('0x25')](_0x3a06b8)){_0x122833[_0x46f8('0x26')]=_0x46f8('0x27');_0x4136c8['message'][_0x46f8('0x28')]=[{'filename':_0xa95bbf,'path':_0x3a06b8}];_0x4136c8[_0x46f8('0x29')]['text']=util[_0x46f8('0x18')](_0x46f8('0x2a'),JSON[_0x46f8('0x2b')](_0x122833,null,0x2));}else if(fs[_0x46f8('0x25')](_0x333d89)){_0x122833[_0x46f8('0x26')]=_0x46f8('0x27');_0x4136c8[_0x46f8('0x29')][_0x46f8('0x28')]=[{'filename':_0x224f03,'path':_0x333d89}];}else{_0x4136c8[_0x46f8('0x29')][_0x46f8('0x2c')]=_0x46f8('0x2d');if(!_0x39a34f[_0x46f8('0x2e')]){_0x53b9bc=![];logger['info'](_0x46f8('0x2f'));}}if(_0x53b9bc){return client[_0x46f8('0x30')](_0x46f8('0x31'),_0x4136c8)[_0x46f8('0x32')](function(_0x46e592){if(_0x46e592['error']){return logger[_0x46f8('0x33')]('error\x20mail',JSON[_0x46f8('0x2b')](_0x46e592));}return logger[_0x46f8('0xc')]('email\x20sent');})[_0x46f8('0x34')](function(_0x192119){return logger['error'](_0x46f8('0x35'),JSON['stringify'](_0x192119));});}};}function handleError(){return function(_0x19ae01){return logger[_0x46f8('0x33')](JSON[_0x46f8('0x2b')](_0x19ae01));};}function handleResult(_0x4165db){return function(_0x5c3bf1){logger[_0x46f8('0xc')](_0x46f8('0x36'),JSON[_0x46f8('0x2b')](_0x5c3bf1));if(_0x4165db['MailAccount']&&_0x4165db[_0x46f8('0xf')]['Smtp']&&!_[_0x46f8('0x37')](_0x4165db['email'])){setTimeout(handleSendEmail(_0x4165db,_0x5c3bf1),0x3c*0x3e8);}};}function handleJob(_0x31df75){return function(){try{if(_[_0x46f8('0x37')](_0x31df75[_0x46f8('0x38')])){return logger['info'](_0x46f8('0x39'));}if(_['isNil'](_0x31df75['subtractUnit'])){return logger[_0x46f8('0xc')](_0x46f8('0x3a'));}var _0x25853d={'startDate':moment()[_0x46f8('0x3b')](_0x31df75[_0x46f8('0x38')],_0x31df75['subtractUnit'])[_0x46f8('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x46f8('0x18')](_0x46f8('0x3c')),'type':_0x46f8('0x3d'),'output':_0x31df75[_0x46f8('0x3e')],'name':_0x31df75['name']};if(!_[_0x46f8('0x37')](_0x31df75[_0x46f8('0x3f')])){logger[_0x46f8('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x31df75[_0x46f8('0x3f')]);return analyticDefaultReportController['runReport']({'id':_0x31df75[_0x46f8('0x3f')]},_0x25853d)['then'](handleResult(_0x31df75))[_0x46f8('0x34')](handleError());}if(!_['isNil'](_0x31df75[_0x46f8('0x40')])){logger[_0x46f8('0xc')](_0x46f8('0x41'),_0x31df75[_0x46f8('0x40')]);return analyticCustomReportController[_0x46f8('0x42')]({'id':_0x31df75[_0x46f8('0x40')]},_0x25853d)[_0x46f8('0x32')](handleResult(_0x31df75))['catch'](handleError());}}catch(_0x335f41){logger[_0x46f8('0x33')](JSON[_0x46f8('0x2b')](_0x335f41));}return logger['info'](_0x46f8('0x43'));};}function getJobs(_0x50ce17){var _0x58f019={};if(_0x50ce17){_0x58f019['id']=_0x50ce17;}return db[_0x46f8('0x44')]['findAll']({'where':_0x58f019,'include':[{'model':db['MailAccount'],'attributes':['id',_0x46f8('0x1a'),'email'],'include':[{'model':db[_0x46f8('0x45')],'as':'Smtp'}]}]})[_0x46f8('0x32')](function(_0x52974b){var _0x1fbef5=_[_0x46f8('0x46')](manager[_0x46f8('0x47')]);var _0xffb4e7=_['map'](_0x52974b,function(_0x420e8c){return _0x420e8c['id'][_0x46f8('0x48')]();});var _0x21863a=_[_0x46f8('0x49')](_0x52974b,function(_0x2a7381){return _0x2a7381['id']['toString']();});var _0x3e452e=_0x50ce17?_0xffb4e7:_[_0x46f8('0x4a')](_0xffb4e7,_0x1fbef5);var _0x3a3dfe=_['intersection'](_0xffb4e7,_0x1fbef5);var _0x42fece=_['difference'](_0x1fbef5,_0xffb4e7);var _0xe89f45;var _0x33b917;for(_0xe89f45=0x0;_0xe89f45<_0x42fece['length']&&!_0x50ce17;_0xe89f45+=0x1){_0x33b917=_0x42fece[_0xe89f45][_0x46f8('0x48')]();if(manager['exists'](_0x33b917)){manager['stop'](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger['info'](_0x46f8('0x4c'),_0x33b917);}}logger[_0x46f8('0xc')]('toRun',JSON['stringify'](_0x3e452e));for(_0xe89f45=0x0;_0xe89f45<_0x3e452e[_0x46f8('0x4d')];_0xe89f45+=0x1){_0x33b917=_0x3e452e[_0xe89f45][_0x46f8('0x48')]();logger['info']('index',_0x33b917);if(_0x50ce17){logger[_0x46f8('0xc')](_0x46f8('0x4e'),_0x50ce17);logger[_0x46f8('0xc')](JSON[_0x46f8('0x2b')](_0x21863a[_0x33b917]));BPromise['resolve']()['then'](handleJob(_0x21863a[_0x33b917]));logger[_0x46f8('0xc')](_0x46f8('0x4f'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917]['cron']);}else if(_0x21863a[_0x33b917]['cron']&&_0x21863a[_0x33b917]['active']&&moment()[_0x46f8('0x50')](_0x21863a[_0x33b917][_0x46f8('0x51')],_0x21863a[_0x33b917][_0x46f8('0x52')])){manager['add'](_0x33b917,_0x21863a[_0x33b917][_0x46f8('0x53')],handleJob(_0x21863a[_0x33b917]));manager['start'](_0x33b917);logger['info']('add\x20cron',_0x21863a[_0x33b917]['name'],_0x21863a[_0x33b917]['cron']);}else if(manager[_0x46f8('0x54')](_0x33b917)){manager[_0x46f8('0x55')](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger[_0x46f8('0xc')](_0x46f8('0x56'),_0x21863a[_0x33b917]['name'],_0x21863a[_0x33b917][_0x46f8('0x53')]);}}for(_0xe89f45=0x0,_0x33b917;_0xe89f45<_0x3a3dfe[_0x46f8('0x4d')]&&!_0x50ce17;_0xe89f45+=0x1){_0x33b917=_0x3a3dfe[_0xe89f45][_0x46f8('0x48')]();if(manager['exists'](_0x33b917)){if(_0x21863a[_0x33b917][_0x46f8('0x53')]&&_0x21863a[_0x33b917][_0x46f8('0x57')]&&moment()['isBetween'](_0x21863a[_0x33b917][_0x46f8('0x51')],_0x21863a[_0x33b917][_0x46f8('0x52')])){manager[_0x46f8('0x58')](_0x33b917,_0x21863a[_0x33b917][_0x46f8('0x53')],handleJob(_0x21863a[_0x33b917]));logger['info'](_0x46f8('0x59'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917]['cron']);}else{manager[_0x46f8('0x55')](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger[_0x46f8('0xc')](_0x46f8('0x56'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917][_0x46f8('0x53')]);}}}})['catch'](function(_0x3d7a8e){logger[_0x46f8('0x33')](JSON['stringify'](_0x3d7a8e));});}exports[_0x46f8('0x5a')]=function(_0x1a51b5){return getJobs(_0x1a51b5);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x4218=['Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','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','error\x20mail','email\x20sent','catch','stringify','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','exec\x20custom\x20report\x20id:%s','CustomReportId','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','MailAccount','Smtp','service','host','port','secure','auth','user','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','basename','zip','join','existsSync','status','message','text'];(function(_0x58d1b9,_0x47c0c4){var _0x3d78c7=function(_0x90dc49){while(--_0x90dc49){_0x58d1b9['push'](_0x58d1b9['shift']());}};_0x3d78c7(++_0x47c0c4);}(_0x4218,0xec));var _0x8421=function(_0x17dfd2,_0x296c7b){_0x17dfd2=_0x17dfd2-0x0;var _0x51a8d6=_0x4218[_0x17dfd2];return _0x51a8d6;};'use strict';var fs=require('fs');var util=require(_0x8421('0x0'));var path=require(_0x8421('0x1'));var _=require(_0x8421('0x2'));var moment=require('moment');var CronJobManager=require(_0x8421('0x3'));var jayson=require(_0x8421('0x4'));var BPromise=require(_0x8421('0x5'));var logger=require(_0x8421('0x6'))(_0x8421('0x7'));var db=require(_0x8421('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8421('0x9'));var client=jayson[_0x8421('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x11b7df,_0x133530){return function(){logger[_0x8421('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x11b7df['email']);var _0x114b60=!![];var _0x37d054={'tls':{'rejectUnauthorized':![]}};if(_0x11b7df[_0x8421('0xc')][_0x8421('0xd')][_0x8421('0xe')]){_0x37d054[_0x8421('0xe')]=_0x11b7df[_0x8421('0xc')][_0x8421('0xd')][_0x8421('0xe')];}else{_0x37d054[_0x8421('0xf')]=_0x11b7df[_0x8421('0xc')]['Smtp']['host'];_0x37d054['port']=_0x11b7df[_0x8421('0xc')]['Smtp'][_0x8421('0x10')];_0x37d054[_0x8421('0x11')]=_0x11b7df[_0x8421('0xc')][_0x8421('0xd')]['secure'];}if(_0x11b7df[_0x8421('0xc')][_0x8421('0xd')]['authentication']){_0x37d054[_0x8421('0x12')]={'user':_0x11b7df[_0x8421('0xc')][_0x8421('0xd')][_0x8421('0x13')],'pass':_0x11b7df[_0x8421('0xc')][_0x8421('0xd')]['pass']};}var _0x29dac9={'account':_0x37d054,'message':{'from':util[_0x8421('0x14')](_0x8421('0x15'),_0x11b7df[_0x8421('0xc')][_0x8421('0x16')],_0x11b7df['MailAccount'][_0x8421('0x17')]||_0x11b7df[_0x8421('0xc')][_0x8421('0xd')][_0x8421('0x13')]),'to':_0x11b7df[_0x8421('0x17')],'cc':_0x11b7df['cc'],'bcc':_0x11b7df[_0x8421('0x18')],'subject':util[_0x8421('0x14')](_0x8421('0x19'),_0x133530['name'],_0x11b7df[_0x8421('0x1a')],_0x11b7df[_0x8421('0x1b')])}};var _0x463f44=path['join'](__dirname,_0x8421('0x1c'));var _0x1df2ac=_0x133530[_0x8421('0x1d')];var _0x93e48c=util['format']('%s.%s',path[_0x8421('0x1e')](_0x133530['savename'],path['extname'](_0x133530[_0x8421('0x1d')])),_0x8421('0x1f'));var _0x9028ee=path[_0x8421('0x20')](_0x463f44,_0x1df2ac);var _0x144133=path[_0x8421('0x20')](_0x463f44,_0x93e48c);if(fs[_0x8421('0x21')](_0x9028ee)){_0x133530[_0x8421('0x22')]='Sent';_0x29dac9[_0x8421('0x23')]['attachments']=[{'filename':_0x1df2ac,'path':_0x9028ee}];_0x29dac9[_0x8421('0x23')][_0x8421('0x24')]=util['format'](_0x8421('0x25'),JSON['stringify'](_0x133530,null,0x2));}else if(fs[_0x8421('0x21')](_0x144133)){_0x133530[_0x8421('0x22')]=_0x8421('0x26');_0x29dac9[_0x8421('0x23')]['attachments']=[{'filename':_0x93e48c,'path':_0x144133}];}else{_0x29dac9[_0x8421('0x23')][_0x8421('0x24')]=_0x8421('0x27');if(!_0x11b7df[_0x8421('0x28')]){_0x114b60=![];logger['info'](_0x8421('0x29'));}}if(_0x114b60){return client[_0x8421('0x2a')](_0x8421('0x2b'),_0x29dac9)[_0x8421('0x2c')](function(_0xa0f226){if(_0xa0f226[_0x8421('0x2d')]){return logger['error'](_0x8421('0x2e'),JSON['stringify'](_0xa0f226));}return logger[_0x8421('0xb')](_0x8421('0x2f'));})[_0x8421('0x30')](function(_0x5b62ad){return logger[_0x8421('0x2d')]('error\x20mail',JSON[_0x8421('0x31')](_0x5b62ad));});}};}function handleError(){return function(_0x329ddf){return logger['error'](JSON['stringify'](_0x329ddf));};}function handleResult(_0x91f1a1){return function(_0x218aaf){logger['info'](_0x8421('0x32'),JSON['stringify'](_0x218aaf));if(_0x91f1a1[_0x8421('0xc')]&&_0x91f1a1[_0x8421('0xc')][_0x8421('0xd')]&&!_[_0x8421('0x33')](_0x91f1a1['email'])){setTimeout(handleSendEmail(_0x91f1a1,_0x218aaf),0x3c*0x3e8);}};}function handleJob(_0x1b8ed5){return function(){try{if(_[_0x8421('0x33')](_0x1b8ed5[_0x8421('0x1a')])){return logger[_0x8421('0xb')](_0x8421('0x34'));}if(_['isNil'](_0x1b8ed5['subtractUnit'])){return logger['info'](_0x8421('0x35'));}var _0x56f7a1={'startDate':moment()[_0x8421('0x36')](_0x1b8ed5[_0x8421('0x1a')],_0x1b8ed5[_0x8421('0x1b')])[_0x8421('0x14')](_0x8421('0x37')),'endDate':moment()[_0x8421('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x8421('0x38'),'output':_0x1b8ed5[_0x8421('0x39')],'name':_0x1b8ed5[_0x8421('0x16')]};if(!_[_0x8421('0x33')](_0x1b8ed5[_0x8421('0x3a')])){logger[_0x8421('0xb')](_0x8421('0x3b'),_0x1b8ed5[_0x8421('0x3a')]);return analyticDefaultReportController[_0x8421('0x3c')]({'id':_0x1b8ed5[_0x8421('0x3a')]},_0x56f7a1)[_0x8421('0x2c')](handleResult(_0x1b8ed5))['catch'](handleError());}if(!_[_0x8421('0x33')](_0x1b8ed5['CustomReportId'])){logger[_0x8421('0xb')](_0x8421('0x3d'),_0x1b8ed5['CustomReportId']);return analyticCustomReportController[_0x8421('0x3c')]({'id':_0x1b8ed5[_0x8421('0x3e')]},_0x56f7a1)[_0x8421('0x2c')](handleResult(_0x1b8ed5))['catch'](handleError());}}catch(_0x19d42b){logger[_0x8421('0x2d')](JSON[_0x8421('0x31')](_0x19d42b));}return logger[_0x8421('0xb')]('no\x20report\x20id');};}function getJobs(_0x1eb7fd){var _0x2b5be1={};if(_0x1eb7fd){_0x2b5be1['id']=_0x1eb7fd;}return db['Schedule'][_0x8421('0x3f')]({'where':_0x2b5be1,'include':[{'model':db['MailAccount'],'attributes':['id',_0x8421('0x16'),_0x8421('0x17')],'include':[{'model':db[_0x8421('0x40')],'as':_0x8421('0xd')}]}]})[_0x8421('0x2c')](function(_0x3ae339){var _0x383e45=_[_0x8421('0x41')](manager[_0x8421('0x42')]);var _0x1b6716=_[_0x8421('0x43')](_0x3ae339,function(_0x314410){return _0x314410['id']['toString']();});var _0x3277d9=_[_0x8421('0x44')](_0x3ae339,function(_0x4e4c17){return _0x4e4c17['id'][_0x8421('0x45')]();});var _0xc1e57=_0x1eb7fd?_0x1b6716:_[_0x8421('0x46')](_0x1b6716,_0x383e45);var _0x20eec3=_[_0x8421('0x47')](_0x1b6716,_0x383e45);var _0x4aa696=_[_0x8421('0x46')](_0x383e45,_0x1b6716);var _0x428e8c;var _0x54dd50;for(_0x428e8c=0x0;_0x428e8c<_0x4aa696[_0x8421('0x48')]&&!_0x1eb7fd;_0x428e8c+=0x1){_0x54dd50=_0x4aa696[_0x428e8c][_0x8421('0x45')]();if(manager[_0x8421('0x49')](_0x54dd50)){manager[_0x8421('0x4a')](_0x54dd50);manager[_0x8421('0x4b')](_0x54dd50);logger['info']('delete\x20cron',_0x54dd50);}}logger['info'](_0x8421('0x4c'),JSON[_0x8421('0x31')](_0xc1e57));for(_0x428e8c=0x0;_0x428e8c<_0xc1e57[_0x8421('0x48')];_0x428e8c+=0x1){_0x54dd50=_0xc1e57[_0x428e8c][_0x8421('0x45')]();logger[_0x8421('0xb')](_0x8421('0x4d'),_0x54dd50);if(_0x1eb7fd){logger[_0x8421('0xb')](_0x8421('0x4e'),_0x1eb7fd);logger[_0x8421('0xb')](JSON[_0x8421('0x31')](_0x3277d9[_0x54dd50]));BPromise[_0x8421('0x4f')]()['then'](handleJob(_0x3277d9[_0x54dd50]));logger[_0x8421('0xb')](_0x8421('0x50'),_0x3277d9[_0x54dd50][_0x8421('0x16')],_0x3277d9[_0x54dd50]['cron']);}else if(_0x3277d9[_0x54dd50][_0x8421('0x51')]&&_0x3277d9[_0x54dd50][_0x8421('0x52')]&&moment()[_0x8421('0x53')](_0x3277d9[_0x54dd50]['startAt'],_0x3277d9[_0x54dd50][_0x8421('0x54')])){manager['add'](_0x54dd50,_0x3277d9[_0x54dd50]['cron'],handleJob(_0x3277d9[_0x54dd50]));manager[_0x8421('0x55')](_0x54dd50);logger[_0x8421('0xb')](_0x8421('0x56'),_0x3277d9[_0x54dd50][_0x8421('0x16')],_0x3277d9[_0x54dd50][_0x8421('0x51')]);}else if(manager[_0x8421('0x49')](_0x54dd50)){manager[_0x8421('0x4a')](_0x54dd50);manager[_0x8421('0x4b')](_0x54dd50);logger[_0x8421('0xb')](_0x8421('0x57'),_0x3277d9[_0x54dd50][_0x8421('0x16')],_0x3277d9[_0x54dd50][_0x8421('0x51')]);}}for(_0x428e8c=0x0,_0x54dd50;_0x428e8c<_0x20eec3[_0x8421('0x48')]&&!_0x1eb7fd;_0x428e8c+=0x1){_0x54dd50=_0x20eec3[_0x428e8c][_0x8421('0x45')]();if(manager[_0x8421('0x49')](_0x54dd50)){if(_0x3277d9[_0x54dd50][_0x8421('0x51')]&&_0x3277d9[_0x54dd50][_0x8421('0x52')]&&moment()['isBetween'](_0x3277d9[_0x54dd50]['startAt'],_0x3277d9[_0x54dd50][_0x8421('0x54')])){manager[_0x8421('0x58')](_0x54dd50,_0x3277d9[_0x54dd50]['cron'],handleJob(_0x3277d9[_0x54dd50]));logger[_0x8421('0xb')](_0x8421('0x59'),_0x3277d9[_0x54dd50][_0x8421('0x16')],_0x3277d9[_0x54dd50][_0x8421('0x51')]);}else{manager[_0x8421('0x4a')](_0x54dd50);manager[_0x8421('0x4b')](_0x54dd50);logger[_0x8421('0xb')](_0x8421('0x57'),_0x3277d9[_0x54dd50][_0x8421('0x16')],_0x3277d9[_0x54dd50][_0x8421('0x51')]);}}}})[_0x8421('0x30')](function(_0x4954db){logger[_0x8421('0x2d')](JSON[_0x8421('0x31')](_0x4954db));});}exports[_0x8421('0x5a')]=function(_0x1d1977){return getJobs(_0x1d1977);};exports[_0x8421('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file