Built motion from commit a0baffd.|1.0.1
[motion.git] / server / config / scheduler / index.js
1 var _0x23af=["\x53\x63\x68\x65\x64\x75\x6C\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x63\x72\x6F\x6E\x2D\x6A\x6F\x62\x2D\x6D\x61\x6E\x61\x67\x65\x72","\x6C\x6F\x64\x61\x73\x68","\x2E\x2F\x72\x65\x70\x6F\x72\x74\x73","\x44\x65\x6C\x65\x74\x69\x6E\x67\x20","\x6E\x61\x6D\x65","\x20\x6A\x6F\x62","\x6C\x6F\x67","\x69\x64","\x65\x78\x69\x73\x74\x73","\x64\x65\x6C\x65\x74\x65\x4A\x6F\x62","\x49\x20\x67\x6F\x74\x20\x74\x68\x65\x20\x63\x75\x72\x72\x65\x6E\x74\x20\x6A\x6F\x62\x73\x3A\x20","\x4A\x6F\x62\x20","\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x55\x70\x64\x61\x74\x69\x6E\x67\x20","\x61\x63\x74\x69\x76\x65","\x65\x78\x70\x6F\x72\x74\x73","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x2F\x73\x65\x74\x74\x69\x6E\x67\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x73","\x63\x61\x74\x63\x68","\x66\x69\x6E\x61\x6C\x6C\x79","\x72\x6F\x77\x73","\x66\x6F\x72\x45\x61\x63\x68","\x74\x68\x65\x6E","\x74\x79\x70\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x43\x72\x65\x61\x74\x69\x6E\x67\x20\x27","\x27\x20\x6A\x6F\x62","\x30\x30\x20","\x63\x72\x6F\x6E","\x20\x73\x74\x6F\x70\x70\x65\x64","\x61\x64\x64","\x4A\x6F\x62\x20\x27","\x27\x20\x63\x72\x65\x61\x74\x65\x64\x21","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x20","\x45\x72\x72\x6F\x72\x20\x72\x65\x74\x72\x69\x65\x76\x69\x6E\x67\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x21","\x53\x63\x68\x65\x64\x75\x6C\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x65\x78\x74\x72\x61\x63\x74\x52\x65\x70\x6F\x72\x74","\x72\x65\x70\x6F\x72\x74","\x66\x69\x6E\x64\x42\x79\x49\x64","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79"];var Schedule=require(_0x23af[1])[_0x23af[0]];var MailServerOut=require(_0x23af[1])[_0x23af[2]];var CronJobManager=require(_0x23af[3]);var _=require(_0x23af[4]);var Reports=require(_0x23af[5]);function deleteSchedule(_0x6f4bx7,_0x6f4bx8){console[_0x23af[9]](_0x23af[6]+ _0x6f4bx7[_0x23af[7]]+ _0x23af[8]);if(_0x6f4bx8[_0x23af[11]](_0x6f4bx7[_0x23af[10]].toString())){_0x6f4bx8[_0x23af[12]](_0x6f4bx7[_0x23af[10]].toString());console[_0x23af[9]](_0x23af[13]+ _0x6f4bx8)}else {console[_0x23af[9]](_0x23af[14]+ _0x6f4bx7[_0x23af[7]]+ _0x23af[15])}}function updateSchedule(_0x6f4bx7,_0x6f4bx8,_0x6f4bxa){console[_0x23af[9]](_0x23af[16]+ _0x6f4bx7[_0x23af[7]]+ _0x23af[8]);if(_0x6f4bx7[_0x23af[17]]){createJob(_0x6f4bx7,_0x6f4bx8,_0x6f4bxa)}else {deleteSchedule(_0x6f4bx7,_0x6f4bx8)}}module[_0x23af[18]]= function(){var _0x6f4bx8= new CronJobManager();var _0x6f4bxa= new Reports();Schedule[_0x23af[26]]({where:{active:true},attributes:[_0x23af[10],_0x23af[7],_0x23af[25],_0x23af[17]]})[_0x23af[24]](function(_0x6f4bxc){_[_0x23af[23]](_0x6f4bxc[_0x23af[22]],function(_0x6f4bxd){createJob(_0x6f4bxd,_0x6f4bx8,_0x6f4bxa)})})[_0x23af[21]](function(){synchSchedules(_0x6f4bx8,_0x6f4bxa)})[_0x23af[20]](function(_0x6f4bxb){console[_0x23af[9]](_0x23af[19])})};function createJob(_0x6f4bxd,_0x6f4bx8,_0x6f4bxa){console[_0x23af[9]](_0x23af[27]+ _0x6f4bxd[_0x23af[7]]+ _0x23af[28]);_0x6f4bx8[_0x23af[32]](_0x6f4bxd[_0x23af[10]].toString(),_0x23af[29]+ _0x6f4bxd[_0x23af[30]],function(){executeSchedule(_0x6f4bxd[_0x23af[10]],_0x6f4bxa)},{start:true,completion:function(){console[_0x23af[9]](_0x23af[14]+ _0x6f4bxd[_0x23af[7]]+ _0x23af[31])}});console[_0x23af[9]](_0x23af[33]+ _0x6f4bxd[_0x23af[7]]+ _0x23af[34]);console[_0x23af[9]](_0x23af[13]+ _0x6f4bx8)}function executeSchedule(_0x6f4bx10,_0x6f4bxa){console[_0x23af[9]](_0x23af[35],_0x6f4bx10);return Schedule[_0x23af[40]](_0x6f4bx10,{include:[MailServerOut]})[_0x23af[24]](function(_0x6f4bxd){if(!_0x6f4bxd){console[_0x23af[9]](_0x23af[37]);return};switch(_0x6f4bxd[_0x23af[25]]){case _0x23af[39]:_0x6f4bxa[_0x23af[38]](_0x6f4bxd);break;default:}})[_0x23af[20]](function(_0x6f4bxb){console[_0x23af[9]](_0x23af[36])})}function synchSchedules(_0x6f4bx8,_0x6f4bxa){Schedule[_0x23af[42]](function(_0x6f4bx12,_0x6f4bx13){if(_0x6f4bx12[_0x23af[17]]){createJob(_0x6f4bx12[_0x23af[41]],_0x6f4bx8,_0x6f4bxa)}});Schedule[_0x23af[43]](function(_0x6f4bx12,_0x6f4bx13){updateSchedule(_0x6f4bx12[_0x23af[41]],_0x6f4bx8,_0x6f4bxa)});Schedule[_0x23af[44]](function(_0x6f4bx12){deleteSchedule(_0x6f4bx12[_0x23af[41]],_0x6f4bx8)})}