Styled and better process handling

This commit is contained in:
Dunemask 2022-07-19 01:39:57 +00:00
parent 61072ee032
commit a4aeb113bf
5 changed files with 8 additions and 8 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,9 @@ import { rollup } from "rollup";
import caxa from "caxa";
import { verify, normalize } from "./executor-configurator.js";
const { default: executorConfig } = await import(path.resolve("executor.config.js"));
const { default: executorConfig } = await import(
path.resolve("executor.config.js")
);
const __dirname = new URL(".", import.meta.url).pathname;
const { default: caxaPackage } = caxa;

View file

@ -1,4 +1,4 @@
const funcify = (v) => ()=> v;
const funcify = (v) => () => v;
export function verify(config) {
for (var k in config) {

View file

@ -14,10 +14,8 @@ const OUT = "o";
export default class Executor {
constructor(args, config, options = {}) {
this.url = config.url(args) ?? process.env.QUALITEER_URL;
this.jobId =
config.jobId(args) ?? process.env.QUALITEER_JOB_ID;
this.command =
config.command(args) ?? process.env.QUALITEER_COMMAND;
this.jobId = config.jobId(args) ?? process.env.QUALITEER_JOB_ID;
this.command = config.command(args) ?? process.env.QUALITEER_COMMAND;
this.mode = modes.EXEC;
// Internal Buffer
@ -58,7 +56,7 @@ export default class Executor {
onClose() {
console.log("Server disconnected, terminating process.");
this.proc.kill("SIGKILL");
if (this.proc) this.proc.kill("SIGKILL");
}
onProcClose(code) {