mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-10 13:37:01 +03:00
Wait for redis to connect before starting server
This commit is contained in:
@@ -4,6 +4,7 @@ import { createServer } from "./app";
|
||||
import { Logger } from "./utils/logger";
|
||||
import { startAllCrons } from "./cronjob";
|
||||
import { getCommit } from "./utils/getCommit";
|
||||
import { connectionPromise } from "./utils/redis";
|
||||
|
||||
async function init() {
|
||||
process.on("unhandledRejection", (error: any) => {
|
||||
@@ -14,6 +15,7 @@ async function init() {
|
||||
|
||||
try {
|
||||
await initDb();
|
||||
await connectionPromise;
|
||||
} catch (e) {
|
||||
Logger.error(`Init Db: ${e}`);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user