Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / services / routing / server / interval.js
index 3d56bd1..f06d3d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x149a=['error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','format','iftime\x20%s','then','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','lodash','../../../config/logger','routing','client','http','request'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0x149a,0xb7));var _0xa149=function(_0x3c2b5d,_0x27a30c){_0x3c2b5d=_0x3c2b5d-0x0;var _0x52deda=_0x149a[_0x3c2b5d];return _0x52deda;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xa149('0x0'));var logger=require(_0xa149('0x1'))(_0xa149('0x2'));var client=jayson[_0xa149('0x3')][_0xa149('0x4')]({'port':0x232a});function request(_0x3484d4,_0x1f9758){return new BPromise(function(_0x45e94d,_0x9c96c9){return client[_0xa149('0x5')](_0x3484d4,_0x1f9758)['then'](function(_0x4a21cb){if(_0x4a21cb['error']){return _0x9c96c9(_0x4a21cb[_0xa149('0x6')][_0xa149('0x7')]);}else{return _0x45e94d(_0x4a21cb['result']);}})[_0xa149('0x8')](function(_0xc1d6de){return _0x9c96c9(_0xc1d6de);});});}exports['condition']=function(_0x3b281b,_0x608d16,_0x411a25){return function(_0x2501b0){if(_0x411a25[_0xa149('0x9')]&&!_0x411a25['rules'][_0x3b281b]){logger[_0xa149('0xa')](_0xa149('0xb'),_0x3b281b);return _0x2501b0['stop']();}var _0x1709fa=[];for(var _0x5e50f4=0x0;_0x5e50f4<_0x608d16['length'];_0x5e50f4+=0x1){_0x1709fa[_0xa149('0xc')](request('Command',{'command':util[_0xa149('0xd')](_0xa149('0xe'),_0x608d16[_0x5e50f4])})[_0xa149('0xf')](function(_0x2af045){return _0x2af045&&_0x2af045['message']&&_0x2af045['message'][_0xa149('0x10')](_0xa149('0x11'))>=0x0?!![]:![];})[_0xa149('0x8')](function(_0x2e4c96){logger[_0xa149('0x6')]('[%s][INTERVAL]\x20%s',_0x3b281b,_0x608d16[_0x5e50f4]);}));}BPromise[_0xa149('0x12')](_0x1709fa)['then'](function(_0x540b00){var _0x2d3343=_[_0xa149('0x13')](_0x540b00);logger[_0xa149('0xa')](_0xa149('0x14'),_0x3b281b,_0x608d16[_0xa149('0x15')](_0xa149('0x16')),_0x2d3343);_0x2501b0[_0xa149('0x17')](_0x2d3343);})[_0xa149('0x8')](function(_0xea81a2){console[_0xa149('0x18')](_0xea81a2);logger[_0xa149('0x6')](_0xa149('0x14'),_0x3b281b,_0x608d16['join'](_0xa149('0x16')),_0xea81a2[_0xa149('0x19')]);_0x2501b0[_0xa149('0x1a')]();});};};
\ No newline at end of file
+var _0x52ef=['\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','then','error','message','catch','condition','rules','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','some','info','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x342d31,_0x225162){var _0x159adc=function(_0x5ea44b){while(--_0x5ea44b){_0x342d31['push'](_0x342d31['shift']());}};_0x159adc(++_0x225162);}(_0x52ef,0xe3));var _0xf52e=function(_0x39fc84,_0x3a0de1){_0x39fc84=_0x39fc84-0x0;var _0x1f63c1=_0x52ef[_0x39fc84];return _0x1f63c1;};'use strict';var util=require(_0xf52e('0x0'));var BPromise=require(_0xf52e('0x1'));var jayson=require(_0xf52e('0x2'));var _=require(_0xf52e('0x3'));var logger=require(_0xf52e('0x4'))('routing');var client=jayson[_0xf52e('0x5')][_0xf52e('0x6')]({'port':0x232a});function request(_0x474f4d,_0x46511e){return new BPromise(function(_0x3138c1,_0x560f38){return client['request'](_0x474f4d,_0x46511e)[_0xf52e('0x7')](function(_0x118ad7){if(_0x118ad7[_0xf52e('0x8')]){return _0x560f38(_0x118ad7[_0xf52e('0x8')][_0xf52e('0x9')]);}else{return _0x3138c1(_0x118ad7['result']);}})[_0xf52e('0xa')](function(_0x3e923e){return _0x560f38(_0x3e923e);});});}exports[_0xf52e('0xb')]=function(_0x167e23,_0x4cf42c,_0x4a40e7){return function(_0x1de9bb){if(_0x4a40e7[_0xf52e('0xc')]&&!_0x4a40e7[_0xf52e('0xc')][_0x167e23]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x167e23);return _0x1de9bb[_0xf52e('0xd')]();}var _0x69693d=[];for(var _0x59092f=0x0;_0x59092f<_0x4cf42c[_0xf52e('0xe')];_0x59092f+=0x1){_0x69693d[_0xf52e('0xf')](request(_0xf52e('0x10'),{'command':util[_0xf52e('0x11')]('iftime\x20%s',_0x4cf42c[_0x59092f])})[_0xf52e('0x7')](function(_0x305f86){return _0x305f86&&_0x305f86[_0xf52e('0x9')]&&_0x305f86['message'][_0xf52e('0x12')](_0xf52e('0x13'))>=0x0?!![]:![];})['catch'](function(){logger[_0xf52e('0x8')](_0xf52e('0x14'),_0x167e23,_0x4cf42c[_0x59092f]);}));}BPromise['all'](_0x69693d)[_0xf52e('0x7')](function(_0x80fb16){var _0x22bb04=_[_0xf52e('0x15')](_0x80fb16);logger[_0xf52e('0x16')](_0xf52e('0x17'),_0x167e23,_0x4cf42c[_0xf52e('0x18')](_0xf52e('0x19')),_0x22bb04);_0x1de9bb[_0xf52e('0x1a')](_0x22bb04);})[_0xf52e('0xa')](function(_0x34f297){logger[_0xf52e('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x167e23,_0x4cf42c[_0xf52e('0x18')](_0xf52e('0x19')),_0x34f297[_0xf52e('0x1b')]);_0x1de9bb[_0xf52e('0xd')]();});};};
\ No newline at end of file