mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-07-01 00:51:36 +00:00
this doesn't need to be global
This commit is contained in:
parent
a9df41c37d
commit
d845612f51
|
@ -40,8 +40,9 @@ if (config.health.healthz.enabled) {
|
|||
Healthz.listen();
|
||||
}
|
||||
|
||||
let bot: Mjolnir | null = null;
|
||||
(async function () {
|
||||
let bot: Mjolnir | null = null;
|
||||
try {
|
||||
const storagePath = path.isAbsolute(config.dataPath) ? config.dataPath : path.join(__dirname, '../', config.dataPath);
|
||||
const storage = new SimpleFsStorageProvider(path.join(storagePath, "bot.json"));
|
||||
|
||||
|
@ -57,7 +58,8 @@ let bot: Mjolnir | null = null;
|
|||
|
||||
bot = await Mjolnir.setupMjolnirFromConfig(client);
|
||||
await bot.start();
|
||||
})().catch(err => {
|
||||
} catch (err) {
|
||||
bot?.logMessage(LogLevel.ERROR, "index", err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue
Block a user