834fcac577a38c2b306c5382c3952cc20ef00c91
[motion2.git] / server / config / pm2 / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xf315=['bluebird','connected','start','disconnect','stop','restart','then','describe','dump','saved'];(function(_0x56ed56,_0x543500){var _0x1ad3f5=function(_0x347d2d){while(--_0x347d2d){_0x56ed56['push'](_0x56ed56['shift']());}};_0x1ad3f5(++_0x543500);}(_0xf315,0x96));var _0x5f31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf315[_0x20a584];return _0x4b41a8;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5f31('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x1b1ac0,_0x57e605){return pm2['connect'](function(_0x220e97){if(_0x220e97){return _0x57e605(_0x220e97);}return _0x1b1ac0(_0x5f31('0x1'));});});};exports[_0x5f31('0x2')]=function(_0x302391){return connect()['then'](function(){return new BPromise(function(_0x55c552,_0x3be091){return pm2[_0x5f31('0x2')](_0x302391,function(_0x1a9165,_0x3bc653){if(_0x1a9165){return _0x3be091(_0x1a9165);}pm2[_0x5f31('0x3')]();return _0x55c552(_0x3bc653);});});});};exports[_0x5f31('0x4')]=function(_0x1ca2e8){return connect()['then'](function(){return new BPromise(function(_0x348559,_0x23cbd6){return pm2[_0x5f31('0x4')](_0x1ca2e8,function(_0x149819,_0x4eba68){if(_0x149819){return _0x23cbd6(_0x149819);}pm2[_0x5f31('0x3')]();return _0x348559(_0x4eba68);});});});};exports[_0x5f31('0x5')]=function(_0x3ab913){return connect()[_0x5f31('0x6')](function(){return new BPromise(function(_0x1b25ab,_0x13d49f){return pm2['restart'](_0x3ab913,function(_0x1e22fb,_0x5e3a3c){if(_0x1e22fb){return _0x13d49f(_0x1e22fb);}pm2['disconnect']();return _0x1b25ab(_0x5e3a3c);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0xbd1545,_0x49835d){return pm2['list'](function(_0x2fe2ed,_0x370dca){if(_0x2fe2ed){return _0x49835d(_0x2fe2ed);}pm2[_0x5f31('0x3')]();return _0xbd1545(_0x370dca);});});});};exports[_0x5f31('0x7')]=function(_0x3b7256){return connect()[_0x5f31('0x6')](function(){return new BPromise(function(_0xb37e5f,_0x2045f3){return pm2['describe'](_0x3b7256,function(_0x153a8c,_0x225267){if(_0x153a8c){return _0x2045f3(_0x153a8c);}pm2[_0x5f31('0x3')]();return _0xb37e5f(_0x225267);});});});};exports['delete']=function(_0x14a183){return connect()[_0x5f31('0x6')](function(){return new BPromise(function(_0x571582,_0x431800){return pm2['delete'](_0x14a183,function(_0x23e4e4,_0x1e378f){if(_0x23e4e4){return _0x431800(_0x23e4e4);}pm2[_0x5f31('0x3')]();return _0x571582(_0x1e378f);});});});};exports[_0x5f31('0x8')]=function(){return connect()[_0x5f31('0x6')](function(){return new BPromise(function(_0x2a39a2,_0xfa3be8){return pm2[_0x5f31('0x8')](function(_0x13be82){if(_0x13be82){return _0xfa3be8(_0x13be82);}return _0x2a39a2(_0x5f31('0x9'));});});});};