Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / routing / server / applications / agent.js
index 37c6f4d..df04bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x725f=['atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','lodash','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','message','stop','agents','createQueue'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x725f,0x90));var _0xf725=function(_0x54c37e,_0x54468b){_0x54c37e=_0x54c37e-0x0;var _0x52e771=_0x725f[_0x54c37e];return _0x52e771;};'use strict';var schema=require('validate');var _=require(_0xf725('0x0'));var util=require('util');var seqqueue=require(_0xf725('0x1'));var logger=require(_0xf725('0x2'))(_0xf725('0x3'));var strategy=require(_0xf725('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xf725('0x5')},'timeout':{'type':_0xf725('0x6'),'message':_0xf725('0x7')}});function writeLog(_0x31beb8,_0x29a7cb,_0x2f1434){return logger[_0xf725('0x8')](util[_0xf725('0x9')](_0xf725('0xa'),_0x31beb8,_0x29a7cb[_0xf725('0xb')],_0x2f1434));}function handleFindAgent(_0x209444){return function(_0x23f576){return _0x23f576[_0xf725('0xb')][_0xf725('0xc')]()===_0x209444['toLowerCase']();};}exports[_0xf725('0xd')]=function(_0x33c8ab,_0x599c22,_0x48dec5,_0x117a17){return function(_0xdc9fc3){try{var _0x32a522={'name':_0x599c22[0x0],'timeout':_0x599c22[0x1]};var _0xe2c07b=queue[_0xf725('0xe')](_0x32a522,{'typecast':!![]});if(_0xe2c07b[_0xf725('0xf')]){logger[_0xf725('0x10')]('[%s][AGENT]\x20%s',_0x33c8ab,_['map'](_0xe2c07b,_0xf725('0x11'))['join'](',\x20'));_0xdc9fc3[_0xf725('0x12')]();}else{var _0xc3077a=_['find'](_0x48dec5[_0xf725('0x13')],handleFindAgent(_0x32a522[_0xf725('0xb')]));if(_0xc3077a){var _0x1aedaf=(_0x32a522['timeout']||0xa)*0x3e8;var _0x5626a4,_0x33b1d4;var _0x3375f0=seqqueue[_0xf725('0x14')](_0x1aedaf);_0x3375f0['id']=_0x33c8ab;_0x3375f0[_0xf725('0x15')]=_0x1aedaf;_0x3375f0[_0xf725('0x16')]=_0x117a17['channel'];writeLog(_0x33c8ab,_0xc3077a,util['format'](_0xf725('0x17'),_0x1aedaf));_0x48dec5['rules'][_0x33c8ab]['on']('end',function(){logger[_0xf725('0x8')](_0xf725('0x18'),_0x33c8ab);clearTimeout(_0x33b1d4);_0x33b1d4=undefined;_0x3375f0[_0xf725('0x19')]();if(_0x48dec5[_0xf725('0x1a')][_0x33c8ab]){delete _0x48dec5[_0xf725('0x1a')][_0x33c8ab];}_0xdc9fc3[_0xf725('0x12')]();});_0x48dec5[_0xf725('0x1a')][_0x33c8ab]['on'](_0xf725('0x1b'),function(){if(_0x48dec5[_0xf725('0x1a')][_0x33c8ab]){delete _0x48dec5['rules'][_0x33c8ab];}});_0x33b1d4=setTimeout(function(){logger[_0xf725('0x8')](_0xf725('0x1c'),_0x33c8ab);clearTimeout(_0x33b1d4);_0x3375f0['close']();_0xdc9fc3[_0xf725('0x1d')]();},_0x1aedaf);strategy[_0xf725('0x1e')](_0x3375f0,_0xc3077a,_0x48dec5,_0x117a17);}else{logger[_0xf725('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x33c8ab,_0x32a522[_0xf725('0xb')]);_0xdc9fc3['stop']();}}}catch(_0x15ae11){console[_0xf725('0x1f')](_0x15ae11);logger['error'](_0xf725('0x20'),_0x33c8ab,_0x15ae11['stack']);_0xdc9fc3['stop']();}};};
\ No newline at end of file
+var _0xf243=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','close','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue'];(function(_0xc75c31,_0x160f4d){var _0x3e387d=function(_0x53ddbf){while(--_0x53ddbf){_0xc75c31['push'](_0xc75c31['shift']());}};_0x3e387d(++_0x160f4d);}(_0xf243,0x1d2));var _0x3f24=function(_0x44dcf0,_0x1402cd){_0x44dcf0=_0x44dcf0-0x0;var _0x206867=_0xf243[_0x44dcf0];return _0x206867;};'use strict';var schema=require(_0x3f24('0x0'));var _=require(_0x3f24('0x1'));var util=require(_0x3f24('0x2'));var seqqueue=require(_0x3f24('0x3'));var logger=require(_0x3f24('0x4'))(_0x3f24('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3f24('0x6'),'required':!![],'message':_0x3f24('0x7')},'timeout':{'type':'number','message':_0x3f24('0x8')}});function writeLog(_0x304ef7,_0x542744,_0x35c6b2){return logger[_0x3f24('0x9')](util[_0x3f24('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x304ef7,_0x542744[_0x3f24('0xb')],_0x35c6b2));}function handleFindAgent(_0x32978f){return function(_0x29f581){return _0x29f581[_0x3f24('0xb')][_0x3f24('0xc')]()===_0x32978f[_0x3f24('0xc')]();};}exports[_0x3f24('0xd')]=function(_0x48e6dd,_0x130f6f,_0x104645,_0x316b7b){return function(_0x5d6139){try{var _0xe23aec={'name':_0x130f6f[0x0],'timeout':_0x130f6f[0x1]};var _0x35ff67=queue['validate'](_0xe23aec,{'typecast':!![]});if(_0x35ff67[_0x3f24('0xe')]){logger[_0x3f24('0xf')](_0x3f24('0x10'),_0x48e6dd,_[_0x3f24('0x11')](_0x35ff67,_0x3f24('0x12'))[_0x3f24('0x13')](',\x20'));_0x5d6139[_0x3f24('0x14')]();}else{var _0x35faeb=_[_0x3f24('0x15')](_0x104645[_0x3f24('0x16')],handleFindAgent(_0xe23aec[_0x3f24('0xb')]));if(_0x35faeb){var _0x3f95fd=(_0xe23aec['timeout']||0xa)*0x3e8;var _0x36a332,_0x261add;var _0x2373b6=seqqueue[_0x3f24('0x17')](_0x3f95fd);_0x2373b6['id']=_0x48e6dd;_0x2373b6['atimeout']=_0x3f95fd;_0x2373b6['channel']=_0x316b7b[_0x3f24('0x18')];writeLog(_0x48e6dd,_0x35faeb,util[_0x3f24('0xa')](_0x3f24('0x19'),_0x3f95fd));_0x104645[_0x3f24('0x1a')][_0x48e6dd]['on'](_0x3f24('0x1b'),function(){logger[_0x3f24('0x9')](_0x3f24('0x1c'),_0x48e6dd);clearTimeout(_0x261add);_0x261add=undefined;_0x2373b6['close']();if(_0x104645[_0x3f24('0x1a')][_0x48e6dd]){delete _0x104645[_0x3f24('0x1a')][_0x48e6dd];}_0x5d6139['stop']();});_0x104645[_0x3f24('0x1a')][_0x48e6dd]['on']('complete',function(){if(_0x104645[_0x3f24('0x1a')][_0x48e6dd]){delete _0x104645[_0x3f24('0x1a')][_0x48e6dd];}});_0x261add=setTimeout(function(){logger['info'](_0x3f24('0x1d'),_0x48e6dd);clearTimeout(_0x261add);_0x2373b6[_0x3f24('0x1e')]();_0x5d6139['next']();},_0x3f95fd);strategy['agent'](_0x2373b6,_0x35faeb,_0x104645,_0x316b7b);}else{logger['error'](_0x3f24('0x1f'),_0x48e6dd,_0xe23aec[_0x3f24('0xb')]);_0x5d6139[_0x3f24('0x14')]();}}}catch(_0x2fad10){console[_0x3f24('0x20')](_0x2fad10);logger[_0x3f24('0xf')](_0x3f24('0x21'),_0x48e6dd,_0x2fad10[_0x3f24('0x22')]);_0x5d6139['stop']();}};};
\ No newline at end of file