mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
增加手动停止标识
This commit is contained in:
@@ -56,7 +56,9 @@ function run() {
|
||||
for (const key in newEnvObject) {
|
||||
process.env[key] = newEnvObject[key];
|
||||
}
|
||||
console.log(output);
|
||||
if (output) {
|
||||
console.log(output);
|
||||
}
|
||||
if (task_before) {
|
||||
console.log('执行前置命令结束\n');
|
||||
}
|
||||
@@ -89,6 +91,10 @@ try {
|
||||
return;
|
||||
}
|
||||
|
||||
process.on('SIGTERM', (code) => {
|
||||
process.exit(15);
|
||||
});
|
||||
|
||||
run();
|
||||
|
||||
const { sendNotify } = require('./notify.js');
|
||||
|
||||
@@ -5,6 +5,7 @@ import json
|
||||
import builtins
|
||||
import sys
|
||||
import env
|
||||
import signal
|
||||
|
||||
|
||||
def try_parse_int(value):
|
||||
@@ -63,7 +64,8 @@ def run():
|
||||
for key, value in env_json.items():
|
||||
os.environ[key] = value
|
||||
|
||||
print(output)
|
||||
if len(output) > 0:
|
||||
print(output)
|
||||
if task_before:
|
||||
print("执行前置命令结束")
|
||||
|
||||
@@ -95,7 +97,13 @@ def run():
|
||||
os.environ[env_param] = env_str
|
||||
|
||||
|
||||
def handle_sigterm(signum, frame):
|
||||
sys.exit(15)
|
||||
|
||||
|
||||
try:
|
||||
signal.signal(signal.SIGTERM, handle_sigterm)
|
||||
|
||||
run()
|
||||
|
||||
from notify import send
|
||||
|
||||
Reference in New Issue
Block a user