Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / routing / server / interval.js
index b76c304..43861da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x855c=['client','http','request','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','then','message','indexOf','[%s][INTERVAL]\x20%s','all','some','info','join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','routing'];(function(_0x24fae9,_0xb56c59){var _0x581267=function(_0xcdb6c2){while(--_0xcdb6c2){_0x24fae9['push'](_0x24fae9['shift']());}};_0x581267(++_0xb56c59);}(_0x855c,0x1db));var _0xc855=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x855c[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0xc855('0x0'));var BPromise=require('bluebird');var jayson=require(_0xc855('0x1'));var _=require(_0xc855('0x2'));var logger=require(_0xc855('0x3'))(_0xc855('0x4'));var client=jayson[_0xc855('0x5')][_0xc855('0x6')]({'port':0x232a});function request(_0x15ecc0,_0x2d3b0b){return new BPromise(function(_0x2446af,_0x5c8e28){return client[_0xc855('0x7')](_0x15ecc0,_0x2d3b0b)['then'](function(_0x2f7bec){if(_0x2f7bec[_0xc855('0x8')]){return _0x5c8e28(_0x2f7bec[_0xc855('0x8')]['message']);}else{return _0x2446af(_0x2f7bec[_0xc855('0x9')]);}})[_0xc855('0xa')](function(_0x3d6e55){return _0x5c8e28(_0x3d6e55);});});}exports[_0xc855('0xb')]=function(_0x2b0dd7,_0x2ae3a3,_0x54f6a4){return function(_0x2eb20e){if(_0x54f6a4[_0xc855('0xc')]&&!_0x54f6a4['rules'][_0x2b0dd7]){logger['info'](_0xc855('0xd'),_0x2b0dd7);return _0x2eb20e[_0xc855('0xe')]();}var _0x6124f4=[];for(var _0x57bc8b=0x0;_0x57bc8b<_0x2ae3a3[_0xc855('0xf')];_0x57bc8b+=0x1){_0x6124f4['push'](request(_0xc855('0x10'),{'command':util['format'](_0xc855('0x11'),_0x2ae3a3[_0x57bc8b])})[_0xc855('0x12')](function(_0x1827ca){return _0x1827ca&&_0x1827ca['message']&&_0x1827ca[_0xc855('0x13')][_0xc855('0x14')]('true')>=0x0?!![]:![];})[_0xc855('0xa')](function(_0x459a3c){logger[_0xc855('0x8')](_0xc855('0x15'),_0x2b0dd7,_0x2ae3a3[_0x57bc8b]);}));}BPromise[_0xc855('0x16')](_0x6124f4)[_0xc855('0x12')](function(_0x2bca15){var _0x28958e=_[_0xc855('0x17')](_0x2bca15);logger[_0xc855('0x18')]('[%s][INTERVAL]\x20%s\x20%s',_0x2b0dd7,_0x2ae3a3[_0xc855('0x19')](_0xc855('0x1a')),_0x28958e);_0x2eb20e[_0xc855('0x1b')](_0x28958e);})[_0xc855('0xa')](function(_0x3121ee){console[_0xc855('0x1c')](_0x3121ee);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x2b0dd7,_0x2ae3a3[_0xc855('0x19')](_0xc855('0x1a')),_0x3121ee[_0xc855('0x1d')]);_0x2eb20e[_0xc855('0xe')]();});};};
\ No newline at end of file
+var _0xf88b=['when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','../../../utils/iftime','../../../config/logger','rules','info','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xf88b,0x163));var _0xbf88=function(_0x20f74d,_0x264de5){_0x20f74d=_0x20f74d-0x0;var _0xb0fbb4=_0xf88b[_0x20f74d];return _0xb0fbb4;};'use strict';var _=require('lodash');var iftime=require(_0xbf88('0x0'))['iftime'];var logger=require(_0xbf88('0x1'))('routing');exports['condition']=function(_0x5e19f2,_0x5d452f,_0x256bd4){return function(_0x39c74d){if(_0x256bd4['rules']&&!_0x256bd4[_0xbf88('0x2')][_0x5e19f2]){logger[_0xbf88('0x3')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5e19f2);return _0x39c74d['stop']();}var _0x1ff5df=_0x5d452f[_0xbf88('0x4')](function(_0x571f67){return iftime(_0x571f67);});var _0x4c4832=_[_0xbf88('0x5')](_0x1ff5df);if(_0x4c4832){logger[_0xbf88('0x3')](_0xbf88('0x6'),_0x5e19f2,_0x5d452f['join'](_0xbf88('0x7')),_0x4c4832);_0x39c74d[_0xbf88('0x8')](_0x4c4832);}else{logger['info'](_0xbf88('0x9'),_0x5e19f2,_0x5d452f[_0xbf88('0xa')]('\x20|\x20'));_0x39c74d['stop']();}};};
\ No newline at end of file