mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
Check redis connection
--------- Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
parent
0c2643fe84
commit
00e42db681
@ -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",
|
||||
|
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",
|
||||
"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\"",
|
||||
|
Loading…
Reference in New Issue
Block a user