perf(server): Redis接続をストリーミング接続ごとに作らず、プロセス全体で共有するように

This commit is contained in:
syuilo
2021-03-23 11:53:25 +09:00
parent 6b753b05d6
commit 48ea805999
2 changed files with 13 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
import * as redis from 'redis';
import config from '../config';
export default redis.createClient(
const client = redis.createClient(
config.redis.port,
config.redis.host,
{
@@ -10,3 +10,7 @@ export default redis.createClient(
db: config.redis.db || 0
}
);
client.subscribe(config.host);
export default client;