Check redis connection

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
Masaya Suzuki 2023-02-24 14:09:17 +09:00 committed by ThatOneCalculator
parent 0c2643fe84
commit 00e42db681
3 changed files with 12 additions and 1 deletions

View File

@ -11,7 +11,7 @@
"scripts": {
"rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp",
"build": "pnpm -r run build && pnpm run gulp",
"start": "pnpm --filter backend run start",
"start": "pnpm check:connect && pnpm --filter backend run start",
"start:test": "pnpm --filter backend run start:test",
"init": "pnpm run migrate",
"migrate": "pnpm --filter backend run migrate",

View File

@ -0,0 +1,10 @@
import {loadConfig} from './built/config.js';
import {createRedisConnection} from "./built/redis.js";
const config = loadConfig();
const redis = createRedisConnection(config);
redis.on('connect', () => redis.disconnect());
redis.on('error', (e) => {
throw e;
});

View File

@ -8,6 +8,7 @@
"start:test": "NODE_ENV=test pnpm node ./built/index.js",
"migrate": "typeorm migration:run -d ormconfig.js",
"revertmigration": "typeorm migration:revert -d ormconfig.js",
"check:connect": "node ./check_connect.js",
"build": "pnpm swc src -d built -D",
"watch": "pnpm swc src -d built -D -w",
"lint": "pnpm rome check \"src/**/*.ts\"",