Styled and better process handling
This commit is contained in:
parent
61072ee032
commit
a4aeb113bf
5 changed files with 8 additions and 8 deletions
BIN
bin/executor
BIN
bin/executor
Binary file not shown.
2
dist/bundles/qualiteer-executor.mjs
vendored
2
dist/bundles/qualiteer-executor.mjs
vendored
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,9 @@ import { rollup } from "rollup";
|
||||||
import caxa from "caxa";
|
import caxa from "caxa";
|
||||||
|
|
||||||
import { verify, normalize } from "./executor-configurator.js";
|
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 __dirname = new URL(".", import.meta.url).pathname;
|
||||||
const { default: caxaPackage } = caxa;
|
const { default: caxaPackage } = caxa;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const funcify = (v) => ()=> v;
|
const funcify = (v) => () => v;
|
||||||
|
|
||||||
export function verify(config) {
|
export function verify(config) {
|
||||||
for (var k in config) {
|
for (var k in config) {
|
||||||
|
|
|
@ -14,10 +14,8 @@ const OUT = "o";
|
||||||
export default class Executor {
|
export default class Executor {
|
||||||
constructor(args, config, options = {}) {
|
constructor(args, config, options = {}) {
|
||||||
this.url = config.url(args) ?? process.env.QUALITEER_URL;
|
this.url = config.url(args) ?? process.env.QUALITEER_URL;
|
||||||
this.jobId =
|
this.jobId = config.jobId(args) ?? process.env.QUALITEER_JOB_ID;
|
||||||
config.jobId(args) ?? process.env.QUALITEER_JOB_ID;
|
this.command = config.command(args) ?? process.env.QUALITEER_COMMAND;
|
||||||
this.command =
|
|
||||||
config.command(args) ?? process.env.QUALITEER_COMMAND;
|
|
||||||
this.mode = modes.EXEC;
|
this.mode = modes.EXEC;
|
||||||
|
|
||||||
// Internal Buffer
|
// Internal Buffer
|
||||||
|
@ -58,7 +56,7 @@ export default class Executor {
|
||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
console.log("Server disconnected, terminating process.");
|
console.log("Server disconnected, terminating process.");
|
||||||
this.proc.kill("SIGKILL");
|
if (this.proc) this.proc.kill("SIGKILL");
|
||||||
}
|
}
|
||||||
|
|
||||||
onProcClose(code) {
|
onProcClose(code) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue