Built motion from commit (unavailable).|2.5.16
[motion2.git] / server / services / routing / model / mailQueue.js
index 8ac5d52..c2b0af0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4075=['defaults','localhost','socket.io-emitter','name','timeout','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','exports','lodash','md5','../../../config/environment','redis'];(function(_0x3c9a99,_0x277cf0){var _0x39e144=function(_0x2ede7b){while(--_0x2ede7b){_0x3c9a99['push'](_0x3c9a99['shift']());}};_0x39e144(++_0x277cf0);}(_0x4075,0xcc));var _0x5407=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x4075[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0x5407('0x0'));var md5=require(_0x5407('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x5407('0x2'));config[_0x5407('0x3')]=_[_0x5407('0x4')](config[_0x5407('0x3')],{'host':_0x5407('0x5'),'port':0x18eb});var io=require(_0x5407('0x6'))(new Redis(config[_0x5407('0x3')]));function MailQueue(_0x3ebc84){this['id']=_0x3ebc84['id']||0x0;this[_0x5407('0x7')]=_0x3ebc84['name']||'';this[_0x5407('0x8')]=_0x3ebc84[_0x5407('0x8')]||0xa;this['strategy']=_0x3ebc84['strategy']||'beepall';this[_0x5407('0x9')]=_0x3ebc84['Agents'];this['mapAgentsId']={};this[_0x5407('0xa')]=0x0;this[_0x5407('0x1')]='';this[_0x5407('0xb')]();this[_0x5407('0xc')]();}MailQueue[_0x5407('0xd')]['updateRouting']=function(){var _0x3d51b7=this[_0x5407('0xe')][_0x5407('0xf')];this[_0x5407('0xe')]=_['map'](this[_0x5407('0x9')],'id');this[_0x5407('0xe')][_0x5407('0xf')]=_0x3d51b7;};MailQueue[_0x5407('0xd')][_0x5407('0xc')]=function(){this['loggedIn']=0x0;this[_0x5407('0x10')]=0x0;for(var _0x4b6767=0x0;_0x4b6767<this['Agents'][_0x5407('0x11')];_0x4b6767+=0x1){if(this[_0x5407('0x9')][_0x4b6767]['online']){this[_0x5407('0x12')]+=0x1;}if(this[_0x5407('0x9')][_0x4b6767][_0x5407('0x13')]){this[_0x5407('0x10')]+=0x1;}}this[_0x5407('0x14')]=this['loggedIn']-this['paused'];this['available']=this[_0x5407('0x14')]>=0x0?this[_0x5407('0x14')]:0x0;var _0x1a1849={'id':this['id'],'available':this[_0x5407('0x14')],'loggedIn':this[_0x5407('0x12')],'name':this[_0x5407('0x7')],'paused':this[_0x5407('0x10')],'waiting':this[_0x5407('0xa')]};var _0xf1219b=md5(JSON[_0x5407('0x15')](_0x1a1849));if(this[_0x5407('0x1')]!==_0xf1219b){this[_0x5407('0x1')]=_0xf1219b;io['to'](util[_0x5407('0x16')](_0x5407('0x17'),_0x1a1849[_0x5407('0x7')]))[_0x5407('0x18')]('mail_queue:save',_0x1a1849);}};module[_0x5407('0x19')]=MailQueue;
\ No newline at end of file
+var _0xfb67=['map','length','online','loggedIn','mailPause','paused','available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr'];(function(_0x5ab572,_0x2fd4af){var _0x356147=function(_0x405806){while(--_0x405806){_0x5ab572['push'](_0x5ab572['shift']());}};_0x356147(++_0x2fd4af);}(_0xfb67,0xdd));var _0x7fb6=function(_0x5ecef3,_0xcce20c){_0x5ecef3=_0x5ecef3-0x0;var _0x570149=_0xfb67[_0x5ecef3];return _0x570149;};'use strict';var _=require(_0x7fb6('0x0'));var md5=require(_0x7fb6('0x1'));var util=require(_0x7fb6('0x2'));var Redis=require(_0x7fb6('0x3'));var config=require(_0x7fb6('0x4'));config[_0x7fb6('0x5')]=_[_0x7fb6('0x6')](config['redis'],{'host':_0x7fb6('0x7'),'port':0x18eb});var io=require(_0x7fb6('0x8'))(new Redis(config[_0x7fb6('0x5')]));function MailQueue(_0x1d36a6){this['id']=_0x1d36a6['id']||0x0;this[_0x7fb6('0x9')]=_0x1d36a6['name']||'';this[_0x7fb6('0xa')]=_0x1d36a6[_0x7fb6('0xa')]||0xa;this[_0x7fb6('0xb')]=_0x1d36a6['strategy']||_0x7fb6('0xc');this[_0x7fb6('0xd')]=_0x1d36a6['Agents'];this[_0x7fb6('0xe')]={};this[_0x7fb6('0xf')]=0x0;this[_0x7fb6('0x1')]='';this['updateRouting']();this[_0x7fb6('0x10')]();}MailQueue['prototype'][_0x7fb6('0x11')]=function(){var _0x3a5d46=this[_0x7fb6('0xe')][_0x7fb6('0x12')];this['mapAgentsId']=_[_0x7fb6('0x13')](this[_0x7fb6('0xd')],'id');this[_0x7fb6('0xe')]['_rr']=_0x3a5d46;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x59287e=0x0;_0x59287e<this[_0x7fb6('0xd')][_0x7fb6('0x14')];_0x59287e+=0x1){if(this['Agents'][_0x59287e][_0x7fb6('0x15')]){this[_0x7fb6('0x16')]+=0x1;}if(this[_0x7fb6('0xd')][_0x59287e][_0x7fb6('0x17')]){this[_0x7fb6('0x18')]+=0x1;}}this[_0x7fb6('0x19')]=this[_0x7fb6('0x16')]-this[_0x7fb6('0x18')];this[_0x7fb6('0x19')]=this[_0x7fb6('0x19')]>=0x0?this[_0x7fb6('0x19')]:0x0;var _0x2f8b0a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7fb6('0x16')],'name':this[_0x7fb6('0x9')],'paused':this[_0x7fb6('0x18')],'waiting':this[_0x7fb6('0xf')]};var _0x1cfbaa=md5(JSON[_0x7fb6('0x1a')](_0x2f8b0a));if(this[_0x7fb6('0x1')]!==_0x1cfbaa){this['md5']=_0x1cfbaa;io['to'](util['format'](_0x7fb6('0x1b'),_0x2f8b0a[_0x7fb6('0x9')]))[_0x7fb6('0x1c')](_0x7fb6('0x1d'),_0x2f8b0a);}};module['exports']=MailQueue;
\ No newline at end of file