
const AZL = require("../azeroth");
const path = require('path');

async function go() {
    let scriptInfo = {
        "script": path.join(__dirname, './bin/www'),
        "cwd": path.join(__dirname, './'),
        "args":[
            // '-jar',
            // path.join(__dirname, './springbootstart-web-1.0.0.jar'),
            // '-Xms1000m',
            // '-Xmx1000m',
            // '--spring.profiles.active=prod',
        ],
        "name": "logistics_node",
        "log_date_format": "YYYY-MM-DD HH:mm Z"
    }
    await AZL.axios.post('http://127.0.0.1:8172/pm2server/cmd', {
        cmd: "stop",
        param: scriptInfo
    }).catch(function (error) {
        console.log(error);
    });

    await AZL.axios.post('http://127.0.0.1:8172/pm2server/cmd', {
        cmd: "start",
        param: scriptInfo
    }).catch(function (error) {
        console.log(error);
    });
}
go();
