Built motion from commit 25580385.|2.6.2
[motion2.git] / server / services / routing / model / mailQueue.js
index d8b9fb2..78afde2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fe0=['util','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','online','loggedIn','available','name','mail:queue:%s','emit','mail_queue:save','lodash','md5'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x5fe0,0xe8));var _0x05fe=function(_0x712760,_0x313c26){_0x712760=_0x712760-0x0;var _0x17e6d8=_0x5fe0[_0x712760];return _0x17e6d8;};'use strict';var _=require(_0x05fe('0x0'));var md5=require(_0x05fe('0x1'));var util=require(_0x05fe('0x2'));var Redis=require('ioredis');var config=require(_0x05fe('0x3'));config[_0x05fe('0x4')]=_['defaults'](config['redis'],{'host':_0x05fe('0x5'),'port':0x18eb});var io=require(_0x05fe('0x6'))(new Redis(config[_0x05fe('0x4')]));function MailQueue(_0xaed2bc){this['id']=_0xaed2bc['id']||0x0;this['name']=_0xaed2bc['name']||'';this[_0x05fe('0x7')]=_0xaed2bc['timeout']||0xa;this[_0x05fe('0x8')]=_0xaed2bc['strategy']||_0x05fe('0x9');this[_0x05fe('0xa')]=_0xaed2bc[_0x05fe('0xa')];this[_0x05fe('0xb')]={};this[_0x05fe('0xc')]=0x0;this['md5']='';this[_0x05fe('0xd')]();this['updateRealtime']();}MailQueue[_0x05fe('0xe')][_0x05fe('0xd')]=function(){var _0x16ebbf=this[_0x05fe('0xb')][_0x05fe('0xf')];this['mapAgentsId']=_[_0x05fe('0x10')](this['Agents'],'id');this[_0x05fe('0xb')][_0x05fe('0xf')]=_0x16ebbf;};MailQueue['prototype'][_0x05fe('0x11')]=function(){this['loggedIn']=0x0;this[_0x05fe('0x12')]=0x0;for(var _0x438b29=0x0;_0x438b29<this[_0x05fe('0xa')]['length'];_0x438b29+=0x1){if(this[_0x05fe('0xa')][_0x438b29][_0x05fe('0x13')]){this[_0x05fe('0x14')]+=0x1;}if(this[_0x05fe('0xa')][_0x438b29]['mailPause']){this[_0x05fe('0x12')]+=0x1;}}this[_0x05fe('0x15')]=this[_0x05fe('0x14')]-this['paused'];this[_0x05fe('0x15')]=this['available']>=0x0?this[_0x05fe('0x15')]:0x0;var _0x40a24f={'id':this['id'],'available':this[_0x05fe('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x05fe('0x16')],'paused':this[_0x05fe('0x12')],'waiting':this[_0x05fe('0xc')]};var _0x39f861=md5(JSON['stringify'](_0x40a24f));if(this[_0x05fe('0x1')]!==_0x39f861){this['md5']=_0x39f861;io['to'](util['format'](_0x05fe('0x17'),_0x40a24f[_0x05fe('0x16')]))[_0x05fe('0x18')](_0x05fe('0x19'),_0x40a24f);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0xadb8=['format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','waiting','stringify'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xadb8,0x155));var _0x8adb=function(_0x2e2f84,_0x24e46f){_0x2e2f84=_0x2e2f84-0x0;var _0x448191=_0xadb8[_0x2e2f84];return _0x448191;};'use strict';var _=require(_0x8adb('0x0'));var md5=require(_0x8adb('0x1'));var util=require('util');var Redis=require(_0x8adb('0x2'));var config=require('../../../config/environment');config[_0x8adb('0x3')]=_[_0x8adb('0x4')](config['redis'],{'host':_0x8adb('0x5'),'port':0x18eb});var io=require(_0x8adb('0x6'))(new Redis(config['redis']));function MailQueue(_0x731a93){this['id']=_0x731a93['id']||0x0;this['name']=_0x731a93[_0x8adb('0x7')]||'';this['timeout']=_0x731a93['timeout']||0xa;this['strategy']=_0x731a93['strategy']||_0x8adb('0x8');this[_0x8adb('0x9')]=_0x731a93[_0x8adb('0x9')];this[_0x8adb('0xa')]={};this['waiting']=0x0;this[_0x8adb('0x1')]='';this[_0x8adb('0xb')]();this[_0x8adb('0xc')]();}MailQueue[_0x8adb('0xd')]['updateRouting']=function(){var _0x2e96bd=this['mapAgentsId'][_0x8adb('0xe')];this[_0x8adb('0xa')]=_[_0x8adb('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x8adb('0xe')]=_0x2e96bd;};MailQueue['prototype'][_0x8adb('0xc')]=function(){this[_0x8adb('0x10')]=0x0;this[_0x8adb('0x11')]=0x0;for(var _0x53789f=0x0;_0x53789f<this[_0x8adb('0x9')]['length'];_0x53789f+=0x1){if(this[_0x8adb('0x9')][_0x53789f][_0x8adb('0x12')]){this[_0x8adb('0x10')]+=0x1;}if(this['Agents'][_0x53789f][_0x8adb('0x13')]){this[_0x8adb('0x11')]+=0x1;}}this[_0x8adb('0x14')]=this[_0x8adb('0x10')]-this[_0x8adb('0x11')];this[_0x8adb('0x14')]=this[_0x8adb('0x14')]>=0x0?this[_0x8adb('0x14')]:0x0;var _0x2bb919={'id':this['id'],'available':this[_0x8adb('0x14')],'loggedIn':this[_0x8adb('0x10')],'name':this['name'],'paused':this[_0x8adb('0x11')],'waiting':this[_0x8adb('0x15')]};var _0x31f174=md5(JSON[_0x8adb('0x16')](_0x2bb919));if(this[_0x8adb('0x1')]!==_0x31f174){this['md5']=_0x31f174;io['to'](util[_0x8adb('0x17')](_0x8adb('0x18'),_0x2bb919[_0x8adb('0x7')]))[_0x8adb('0x19')](_0x8adb('0x1a'),_0x2bb919);}};module[_0x8adb('0x1b')]=MailQueue;
\ No newline at end of file