2026.4.0-alpha.2 #11

Merged
last2014 merged 6 commits from develop into main 2026-05-01 13:12:21 +00:00
3 changed files with 13 additions and 11 deletions
Showing only changes of commit 90b308afa0 - Show all commits
+7 -2
View File
@@ -44,15 +44,17 @@ if (config.earthquake?.useHistoryData) {
return;
}
const id = message.id ?? message._id;
const mem = Memory.memory;
if (mem.processedInfo.includes(message.id) && !config.debug) {
if (mem.processedInfo.includes(id) && !config.debug) {
console.log("重複した地震情報: ", message.id);
return;
}
processMessage(message);
if (!config.debug) {
mem.processedInfo.concat([message.id]);
mem.processedInfo.concat([id]);
Memory.memory = mem;
}
});
@@ -76,6 +78,9 @@ const processMessage = async (message: any) => {
}
switch (message.code) {
case 555:
console.log("ピアの地域分布情報を受信しました");
break;
case 551:
{
console.log("地震発生情報を受信しました");
+4 -3
View File
@@ -1,5 +1,6 @@
import client from "@/lib/client";
import initI18n from "@/lib/i18n";
import { format } from "date-fns";
import i18next from "i18next";
import { parentPort } from "node:worker_threads";
@@ -18,12 +19,12 @@ parentPort?.on("message", async () => {
process.exit(1);
}
console.log("新年迎春投稿:", response.uniqid);
console.log("新年迎春投稿:", `${response.uniqid} (${format(new Date(), "yyyy/M/d H:mm:ss:SSS")})`);
process.exit(0);
} catch (err: any) {
console.error("message" in err
? err.message
: err);
} finally {
parentPort?.postMessage("");
process.exit(1);
}
});
+2 -6
View File
@@ -45,15 +45,11 @@ try {
let hnyWorker: Worker | undefined = undefined;
schedule("59 23 31 12 *", () => {
schedule("57 59 23 31 12 *", () => {
hnyWorker = new Worker(`${import.meta.dirname}/feature/hnyNotice.js`);
});
schedule("0 0 1 1 *", () => {
hnyWorker?.once("message", async () => {
await hnyWorker?.terminate();
hnyWorker = undefined;
});
schedule("0 0 0 1 1 *", () => {
hnyWorker?.postMessage("");
});
} catch (err: any) {