mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 19:37:34 -07:00
Check redis connection
--------- Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
parent
0c2643fe84
commit
00e42db681
3 changed files with 12 additions and 1 deletions
|
@ -11,7 +11,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp",
|
"rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp",
|
||||||
"build": "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",
|
"start:test": "pnpm --filter backend run start:test",
|
||||||
"init": "pnpm run migrate",
|
"init": "pnpm run migrate",
|
||||||
"migrate": "pnpm --filter backend run migrate",
|
"migrate": "pnpm --filter backend run migrate",
|
||||||
|
|
10
packages/backend/check_connect.js
Normal file
10
packages/backend/check_connect.js
Normal 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;
|
||||||
|
});
|
|
@ -8,6 +8,7 @@
|
||||||
"start:test": "NODE_ENV=test pnpm node ./built/index.js",
|
"start:test": "NODE_ENV=test pnpm node ./built/index.js",
|
||||||
"migrate": "typeorm migration:run -d ormconfig.js",
|
"migrate": "typeorm migration:run -d ormconfig.js",
|
||||||
"revertmigration": "typeorm migration:revert -d ormconfig.js",
|
"revertmigration": "typeorm migration:revert -d ormconfig.js",
|
||||||
|
"check:connect": "node ./check_connect.js",
|
||||||
"build": "pnpm swc src -d built -D",
|
"build": "pnpm swc src -d built -D",
|
||||||
"watch": "pnpm swc src -d built -D -w",
|
"watch": "pnpm swc src -d built -D -w",
|
||||||
"lint": "pnpm rome check \"src/**/*.ts\"",
|
"lint": "pnpm rome check \"src/**/*.ts\"",
|
||||||
|
|
Loading…
Reference in a new issue