25c5c2628d32c16cc5bf2b0e21ba8d6b8ecad719
[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 _0xb97c=['delete','dump','saved','./config','connect','start','then','disconnect','stop','restart','list','describe'];(function(_0x40566a,_0x24ee2f){var _0xe1b2ec=function(_0x435bf1){while(--_0x435bf1){_0x40566a['push'](_0x40566a['shift']());}};_0xe1b2ec(++_0x24ee2f);}(_0xb97c,0x19b));var _0xcb97=function(_0x20e0bd,_0x2d1b08){_0x20e0bd=_0x20e0bd-0x0;var _0x74e319=_0xb97c[_0x20e0bd];return _0x74e319;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0xcb97('0x0'));function connect(){return new BPromise(function(_0x7d7206,_0x18cecd){return pm2[_0xcb97('0x1')](function(_0x58b860){if(_0x58b860){return _0x18cecd(_0x58b860);}return _0x7d7206('connected');});});};exports[_0xcb97('0x2')]=function(_0x11bfb9){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x1e0e94,_0xf87cc2){return pm2['start'](_0x11bfb9,function(_0xf7c6e5,_0x28d3d4){if(_0xf7c6e5){return _0xf87cc2(_0xf7c6e5);}pm2[_0xcb97('0x4')]();return _0x1e0e94(_0x28d3d4);});});});};exports[_0xcb97('0x5')]=function(_0x178efa){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x39f07,_0xa02740){return pm2['stop'](_0x178efa,function(_0x23626b,_0x19dee4){if(_0x23626b){return _0xa02740(_0x23626b);}pm2['disconnect']();return _0x39f07(_0x19dee4);});});});};exports[_0xcb97('0x6')]=function(_0x2d7ed9){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x1bf6f5,_0x2c460e){return pm2[_0xcb97('0x6')](_0x2d7ed9,function(_0x12c230,_0x5d48fa){if(_0x12c230){return _0x2c460e(_0x12c230);}pm2[_0xcb97('0x4')]();return _0x1bf6f5(_0x5d48fa);});});});};exports[_0xcb97('0x7')]=function(){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x21e55b,_0x52a246){return pm2['list'](function(_0x2cde2c,_0x1a720e){if(_0x2cde2c){return _0x52a246(_0x2cde2c);}pm2['disconnect']();return _0x21e55b(_0x1a720e);});});});};exports[_0xcb97('0x8')]=function(_0x44c2fb){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x323b1d,_0x39aa74){return pm2['describe'](_0x44c2fb,function(_0xa15bd7,_0x4d4d43){if(_0xa15bd7){return _0x39aa74(_0xa15bd7);}pm2[_0xcb97('0x4')]();return _0x323b1d(_0x4d4d43);});});});};exports[_0xcb97('0x9')]=function(_0xee193a){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x55790a,_0x2473d0){return pm2[_0xcb97('0x9')](_0xee193a,function(_0x208411,_0x1f01db){if(_0x208411){return _0x2473d0(_0x208411);}pm2[_0xcb97('0x4')]();return _0x55790a(_0x1f01db);});});});};exports[_0xcb97('0xa')]=function(){return connect()[_0xcb97('0x3')](function(){return new BPromise(function(_0x597ffb,_0x21b95d){return pm2[_0xcb97('0xa')](function(_0x2c8e62){if(_0x2c8e62){return _0x21b95d(_0x2c8e62);}return _0x597ffb(_0xcb97('0xb'));});});});};