Built motion from commit 47436d59.|2.6.7
[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 _0x06fe=['list','describe','delete','dump','saved','bluebird','start','then','disconnect','stop','restart'];(function(_0x4a67eb,_0x431aab){var _0x1fe03b=function(_0x27213e){while(--_0x27213e){_0x4a67eb['push'](_0x4a67eb['shift']());}};_0x1fe03b(++_0x431aab);}(_0x06fe,0xd6));var _0xe06f=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0x06fe[_0x1663ae];return _0x30ffb8;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe06f('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x47815d,_0x58ac5f){return pm2['connect'](function(_0x1925a4){if(_0x1925a4){return _0x58ac5f(_0x1925a4);}return _0x47815d('connected');});});};exports[_0xe06f('0x1')]=function(_0x487700){return connect()[_0xe06f('0x2')](function(){return new BPromise(function(_0x145e26,_0xe4363d){return pm2[_0xe06f('0x1')](_0x487700,function(_0x497064,_0x304f60){if(_0x497064){return _0xe4363d(_0x497064);}pm2[_0xe06f('0x3')]();return _0x145e26(_0x304f60);});});});};exports[_0xe06f('0x4')]=function(_0x104654){return connect()[_0xe06f('0x2')](function(){return new BPromise(function(_0x2b756b,_0x3ada1){return pm2['stop'](_0x104654,function(_0x17890c,_0x3d23dc){if(_0x17890c){return _0x3ada1(_0x17890c);}pm2[_0xe06f('0x3')]();return _0x2b756b(_0x3d23dc);});});});};exports[_0xe06f('0x5')]=function(_0x543063){return connect()['then'](function(){return new BPromise(function(_0xb031b3,_0x381041){return pm2['restart'](_0x543063,function(_0x2ce8ad,_0x2ed577){if(_0x2ce8ad){return _0x381041(_0x2ce8ad);}pm2[_0xe06f('0x3')]();return _0xb031b3(_0x2ed577);});});});};exports[_0xe06f('0x6')]=function(){return connect()[_0xe06f('0x2')](function(){return new BPromise(function(_0x325c28,_0x5a3be6){return pm2[_0xe06f('0x6')](function(_0x58e6aa,_0x478937){if(_0x58e6aa){return _0x5a3be6(_0x58e6aa);}pm2[_0xe06f('0x3')]();return _0x325c28(_0x478937);});});});};exports[_0xe06f('0x7')]=function(_0x28cee3){return connect()['then'](function(){return new BPromise(function(_0x4d5a84,_0x357da1){return pm2[_0xe06f('0x7')](_0x28cee3,function(_0xf4e7b,_0x3d2242){if(_0xf4e7b){return _0x357da1(_0xf4e7b);}pm2[_0xe06f('0x3')]();return _0x4d5a84(_0x3d2242);});});});};exports[_0xe06f('0x8')]=function(_0x5caffb){return connect()[_0xe06f('0x2')](function(){return new BPromise(function(_0x3e9c61,_0x3e8bcf){return pm2[_0xe06f('0x8')](_0x5caffb,function(_0x2535ad,_0x54b645){if(_0x2535ad){return _0x3e8bcf(_0x2535ad);}pm2[_0xe06f('0x3')]();return _0x3e9c61(_0x54b645);});});});};exports[_0xe06f('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0xebc78,_0x29c758){return pm2[_0xe06f('0x9')](function(_0x476eba){if(_0x476eba){return _0x29c758(_0x476eba);}return _0xebc78(_0xe06f('0xa'));});});});};