Compare commits
No commits in common. "831612bc77c68cf6433a111bbd299e40d2f3a0be" and "d569c5fd8b79aa5c9ed2c0c128e5e85487b98781" have entirely different histories.
831612bc77
...
d569c5fd8b
17
src/index.ts
17
src/index.ts
|
@ -2,8 +2,8 @@ import { start as startRpc } from "./modules/rpc.js";
|
||||||
import { start as startRelay } from "./modules/relay.js";
|
import { start as startRelay } from "./modules/relay.js";
|
||||||
import { start as startApp } from "./modules/app";
|
import { start as startApp } from "./modules/app";
|
||||||
import config from "./config.js";
|
import config from "./config.js";
|
||||||
import { getPluginAPI, loadPlugins } from "./modules/plugin.js";
|
import { loadPlugins } from "./modules/plugin.js";
|
||||||
import { start as startSwarm, get as getSwarm } from "./modules/swarm.js";
|
import { start as startSwarm } from "./modules/swarm.js";
|
||||||
import * as bip39 from "@scure/bip39";
|
import * as bip39 from "@scure/bip39";
|
||||||
import { wordlist } from "@scure/bip39/wordlists/english";
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
||||||
|
|
||||||
|
@ -26,12 +26,9 @@ boot();
|
||||||
process.on("uncaughtException", function (err) {
|
process.on("uncaughtException", function (err) {
|
||||||
console.log(`Caught exception: ${err.message} ${err.stack}`);
|
console.log(`Caught exception: ${err.message} ${err.stack}`);
|
||||||
});
|
});
|
||||||
|
process.on("SIGINT", function () {
|
||||||
async function shutdown() {
|
|
||||||
await getPluginAPI().emitAsync("core.shutdown");
|
|
||||||
await getSwarm().destroy();
|
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
});
|
||||||
|
process.on("SIGTERM", function () {
|
||||||
process.on("SIGINT", shutdown);
|
process.exit();
|
||||||
process.on("SIGTERM", shutdown);
|
});
|
||||||
|
|
Loading…
Reference in New Issue