Built motion from commit caf7d5f0.|2.5.39
[motion2.git] / server / services / routing / model / mailQueue.js
index 88f3ffc..a197cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e2d=['available','stringify','mail:queue:%s','emit','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online'];(function(_0x3f994e,_0x6f0bb8){var _0x40dbcf=function(_0x1a7b09){while(--_0x1a7b09){_0x3f994e['push'](_0x3f994e['shift']());}};_0x40dbcf(++_0x6f0bb8);}(_0x7e2d,0xd0));var _0xd7e2=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x7e2d[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xd7e2('0x0'));var md5=require('md5');var util=require(_0xd7e2('0x1'));var Redis=require(_0xd7e2('0x2'));var config=require('../../../config/environment');config[_0xd7e2('0x3')]=_[_0xd7e2('0x4')](config[_0xd7e2('0x3')],{'host':_0xd7e2('0x5'),'port':0x18eb});var io=require(_0xd7e2('0x6'))(new Redis(config[_0xd7e2('0x3')]));function MailQueue(_0xe1c5af){this['id']=_0xe1c5af['id']||0x0;this[_0xd7e2('0x7')]=_0xe1c5af[_0xd7e2('0x7')]||'';this['timeout']=_0xe1c5af[_0xd7e2('0x8')]||0xa;this[_0xd7e2('0x9')]=_0xe1c5af[_0xd7e2('0x9')]||_0xd7e2('0xa');this['Agents']=_0xe1c5af[_0xd7e2('0xb')];this[_0xd7e2('0xc')]={};this[_0xd7e2('0xd')]=0x0;this[_0xd7e2('0xe')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xd7e2('0xf')][_0xd7e2('0x10')]=function(){var _0x4a3aa2=this[_0xd7e2('0xc')][_0xd7e2('0x11')];this[_0xd7e2('0xc')]=_[_0xd7e2('0x12')](this[_0xd7e2('0xb')],'id');this[_0xd7e2('0xc')][_0xd7e2('0x11')]=_0x4a3aa2;};MailQueue[_0xd7e2('0xf')][_0xd7e2('0x13')]=function(){this[_0xd7e2('0x14')]=0x0;this[_0xd7e2('0x15')]=0x0;for(var _0x5a7819=0x0;_0x5a7819<this[_0xd7e2('0xb')][_0xd7e2('0x16')];_0x5a7819+=0x1){if(this[_0xd7e2('0xb')][_0x5a7819][_0xd7e2('0x17')]){this[_0xd7e2('0x14')]+=0x1;}if(this['Agents'][_0x5a7819]['mailPause']){this['paused']+=0x1;}}this['available']=this[_0xd7e2('0x14')]-this[_0xd7e2('0x15')];this[_0xd7e2('0x18')]=this[_0xd7e2('0x18')]>=0x0?this[_0xd7e2('0x18')]:0x0;var _0x197dac={'id':this['id'],'available':this[_0xd7e2('0x18')],'loggedIn':this[_0xd7e2('0x14')],'name':this[_0xd7e2('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x180d7b=md5(JSON[_0xd7e2('0x19')](_0x197dac));if(this['md5']!==_0x180d7b){this[_0xd7e2('0xe')]=_0x180d7b;io['to'](util['format'](_0xd7e2('0x1a'),_0x197dac[_0xd7e2('0x7')]))[_0xd7e2('0x1b')]('mail_queue:save',_0x197dac);}};module[_0xd7e2('0x1c')]=MailQueue;
\ No newline at end of file
+var _0x64a1=['lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','length','online','loggedIn','available','paused','waiting','stringify','format','emit'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x64a1,0xb6));var _0x164a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x64a1[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x164a('0x0'));var md5=require(_0x164a('0x1'));var util=require(_0x164a('0x2'));var Redis=require(_0x164a('0x3'));var config=require('../../../config/environment');config[_0x164a('0x4')]=_[_0x164a('0x5')](config[_0x164a('0x4')],{'host':_0x164a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x164a('0x4')]));function MailQueue(_0x30c553){this['id']=_0x30c553['id']||0x0;this[_0x164a('0x7')]=_0x30c553[_0x164a('0x7')]||'';this[_0x164a('0x8')]=_0x30c553[_0x164a('0x8')]||0xa;this[_0x164a('0x9')]=_0x30c553['strategy']||_0x164a('0xa');this['Agents']=_0x30c553[_0x164a('0xb')];this[_0x164a('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x164a('0xd')]();this['updateRealtime']();}MailQueue[_0x164a('0xe')][_0x164a('0xd')]=function(){var _0x143dc5=this[_0x164a('0xc')][_0x164a('0xf')];this['mapAgentsId']=_[_0x164a('0x10')](this[_0x164a('0xb')],'id');this[_0x164a('0xc')][_0x164a('0xf')]=_0x143dc5;};MailQueue[_0x164a('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2b673d=0x0;_0x2b673d<this['Agents'][_0x164a('0x11')];_0x2b673d+=0x1){if(this[_0x164a('0xb')][_0x2b673d][_0x164a('0x12')]){this[_0x164a('0x13')]+=0x1;}if(this['Agents'][_0x2b673d]['mailPause']){this['paused']+=0x1;}}this[_0x164a('0x14')]=this['loggedIn']-this[_0x164a('0x15')];this[_0x164a('0x14')]=this[_0x164a('0x14')]>=0x0?this[_0x164a('0x14')]:0x0;var _0x136d3c={'id':this['id'],'available':this[_0x164a('0x14')],'loggedIn':this[_0x164a('0x13')],'name':this[_0x164a('0x7')],'paused':this[_0x164a('0x15')],'waiting':this[_0x164a('0x16')]};var _0x1075ec=md5(JSON[_0x164a('0x17')](_0x136d3c));if(this[_0x164a('0x1')]!==_0x1075ec){this[_0x164a('0x1')]=_0x1075ec;io['to'](util[_0x164a('0x18')]('mail:queue:%s',_0x136d3c['name']))[_0x164a('0x19')]('mail_queue:save',_0x136d3c);}};module['exports']=MailQueue;
\ No newline at end of file