perf(server): Redis接続をストリーミング接続ごとに作らず、プロセス全体で共有するように
This commit is contained in:
parent
6b753b05d6
commit
48ea805999
2 changed files with 13 additions and 26 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue