Commit acfb0f48 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/js-drone: handle sigint

parent dfda86b6
...@@ -30,7 +30,7 @@ md5sum = d12fbb134c587173ddff46ff1bc6ffe7 ...@@ -30,7 +30,7 @@ md5sum = d12fbb134c587173ddff46ff1bc6ffe7
[main] [main]
_update_hash_filename_ = drone-scripts/main.js.jinja2 _update_hash_filename_ = drone-scripts/main.js.jinja2
md5sum = 9a8ec8a2778f63789f39291795f47e98 md5sum = dfc0ae336c45950846a6e0cf754093a6
[pubsub] [pubsub]
_update_hash_filename_ = drone-scripts/pubsub.js.jinja2 _update_hash_filename_ = drone-scripts/pubsub.js.jinja2
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
} from {{ json_module.dumps(qjs_wrapper) }}; } from {{ json_module.dumps(qjs_wrapper) }};
import { import {
Worker, Worker,
SIGINT,
SIGTERM, SIGTERM,
dup2, dup2,
setTimeout, setTimeout,
...@@ -17,9 +18,8 @@ import { ...@@ -17,9 +18,8 @@ import {
} from "os"; } from "os";
import { err, exit, open, out } from "std"; import { err, exit, open, out } from "std";
(function (arm, console, dup2, err, exit, open, out, scriptArgs, (function (arm, console, dup2, err, exit, open, out, scriptArgs, setTimeout,
setTimeout, start, stop, stopPubsub, takeOffAndWait, Worker, start, stop, stopPubsub, takeOffAndWait, Worker, SIGINT, SIGTERM) {
SIGTERM) {
"use strict"; "use strict";
var CONF_PATH = {{ json_module.dumps(configuration) }}, var CONF_PATH = {{ json_module.dumps(configuration) }},
...@@ -68,6 +68,7 @@ import { err, exit, open, out } from "std"; ...@@ -68,6 +68,7 @@ import { err, exit, open, out } from "std";
} }
signal(SIGTERM, exitWorker.bind(null, 0)); signal(SIGTERM, exitWorker.bind(null, 0));
signal(SIGINT, exitWorker.bind(null, 0));
function exitOnFail(ret, msg) { function exitOnFail(ret, msg) {
if (ret) { if (ret) {
...@@ -180,4 +181,4 @@ import { err, exit, open, out } from "std"; ...@@ -180,4 +181,4 @@ import { err, exit, open, out } from "std";
} }
}; };
}(arm, console, dup2, err, exit, open, out, scriptArgs, setTimeout, start, stop, }(arm, console, dup2, err, exit, open, out, scriptArgs, setTimeout, start, stop,
stopPubsub, takeOffAndWait, Worker, SIGTERM)); stopPubsub, takeOffAndWait, Worker, SIGINT, SIGTERM));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment