fix: Exit redis after setting value so that process can exit
This commit is contained in:
parent
b22a4ddb08
commit
ad116c385a
1 changed files with 11 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ const NODE_PATHS = [].concat(
|
||||||
.filter(fs.existsSync)
|
.filter(fs.existsSync)
|
||||||
);
|
);
|
||||||
|
|
||||||
execute();
|
execute().catch(e => console.error(e));
|
||||||
|
|
||||||
async function execute() {
|
async function execute() {
|
||||||
console.time(TOTAL_BUILD_TIME);
|
console.time(TOTAL_BUILD_TIME);
|
||||||
|
|
@ -81,7 +81,7 @@ async function execute() {
|
||||||
} else {
|
} else {
|
||||||
log("Watching for changes...");
|
log("Watching for changes...");
|
||||||
}
|
}
|
||||||
await write_meta_file(result.metafile);
|
return await write_meta_file(result.metafile);
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_assets_for_apps(apps) {
|
function build_assets_for_apps(apps) {
|
||||||
|
|
@ -287,7 +287,12 @@ function write_meta_file(metafile) {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let client = get_redis_subscriber("redis_cache");
|
let client = get_redis_subscriber("redis_cache");
|
||||||
// update assets_json cache in redis, so that it can be read directly by python
|
// update assets_json cache in redis, so that it can be read directly by python
|
||||||
return client.set("assets_json", assets_json);
|
client.set("assets_json", assets_json, (err) => {
|
||||||
|
if (err) {
|
||||||
|
log_warn("Could not update assets_json in redis_cache");
|
||||||
|
}
|
||||||
|
client.unref();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,7 +301,6 @@ async function notify_redis({ error, success }) {
|
||||||
// notify redis which in turns tells socketio to publish this to browser
|
// notify redis which in turns tells socketio to publish this to browser
|
||||||
|
|
||||||
let payload = null;
|
let payload = null;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
let formatted = await esbuild.formatMessages(error.errors, {
|
let formatted = await esbuild.formatMessages(error.errors, {
|
||||||
kind: "error",
|
kind: "error",
|
||||||
|
|
@ -338,4 +342,6 @@ function open_in_editor() {
|
||||||
subscriber.subscribe("open_in_editor");
|
subscriber.subscribe("open_in_editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
open_in_editor();
|
if (WATCH_MODE) {
|
||||||
|
open_in_editor();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue