Socket
Socket
Sign inDemoInstall

gia-ast

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gia-ast - npm Package Compare versions

Comparing version 0.3.19 to 0.3.20

x__docker_start_meta.js

71

gia-ast-meta.js

@@ -294,5 +294,6 @@ #!/usr/bin/env node

var portnum = config.portbase + modelid;
if (modelid.length > 2) portnum = modelid; //Enable full use of the Port on another range than the port base
const callurl = config.callprotocol + "://" + config.hostname + ":" + portnum + "/" + config.callmethod.replace("/", "");
const callurlmeta = config.callprotocol + "://" + config.hostname + ":" + config.metaportnum + "/" + portnum + ".json";
const callurl = `${config.callprotocol}://${config.hostname}:${portnum}/${config.callmethod.replace("/", "")}`;
const callurlmeta = `${config.callprotocol}://${config.hostname}:${config.metaportnum}/${portnum}.json`;

@@ -376,2 +377,3 @@

var metaretry=3;

@@ -421,3 +423,3 @@ function doTheWork(cFile, config, portnum, callurl, callurlmeta, targetOutput, x1 = -1, x2 = -1, x3 = -1, autosuffix = false) {

};
console.log("Calling : " + config.hostname + ":" + portnum);
console.log("Calling : " + callurl);

@@ -476,20 +478,32 @@ axios.post(callurl, data, options)

.catch(function (errMeta) {
console.log("There was error with meta server (your file might save right anyway");
console.log("---------------------------------------------------");
console.log(errMeta.message);
console.log("---------------------------------------------------");
if (metaretry> 0)
{
//Launch the docker container
startmeta();
metaretry = metaretry -1;
console.log("\t Retrying to launch this function to do the work with the Meta hopefully started");
doTheWork(cFile, config, portnum, callurl, callurlmeta, targetOutput, x1 , x2 , x3 , autosuffix );
console.log("---------------------------------------------------");
console.log("---------TRYING TO SAVE WITHOUT META SERVER DATA----------");
console.log("---------------------------------------------------");
console.log("---------Make this faster by DISABLE astusemetasvr=false in .env ------");
console.log("---------Or start the server ------");
console.log("--");
console.log("---------------------------------------------------");
}
else {
saveStylizedResult(stylizedImage, data, targetOutput, config);
process.exit(3);
});
//@a then save result
console.log("There was error with meta server (your file might save right anyway");
console.log("---------------------------------------------------");
console.log(errMeta.message);
console.log("---------------------------------------------------");
console.log("---------------------------------------------------");
console.log("---------TRYING TO SAVE WITHOUT META SERVER DATA----------");
console.log("---------------------------------------------------");
console.log("---------Make this faster by DISABLE astusemetasvr=false in .env ------");
console.log("---------Or start the server ------");
console.log("--");
console.log("---------------------------------------------------");
saveStylizedResult(stylizedImage, data, targetOutput, config);
process.exit(3);
}
});
//@a then save result
// saveStylizedResult(stylizedImage, targetOutput, config);

@@ -552,1 +566,20 @@ }

function startmeta(){
const { exec } = require("child_process");
exec("docker start ast_meta_server", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
}
{
"name": "gia-ast",
"version": "0.3.19",
"version": "0.3.20",
"description": "A CLI Wrapping AST Web API calls to servers",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc