diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-24 11:34:29 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-24 11:34:29 +0900 |
| commit | 3e11011229ef8459747acdf6d3008dc145280fec (patch) | |
| tree | 8ebc85727c4d295f6583b63d9397651151d4394a /src/db | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.75.1 (diff) | |
| download | misskey-3e11011229ef8459747acdf6d3008dc145280fec.tar.gz misskey-3e11011229ef8459747acdf6d3008dc145280fec.tar.bz2 misskey-3e11011229ef8459747acdf6d3008dc145280fec.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/db')
| -rw-r--r-- | src/db/elasticsearch.ts | 2 | ||||
| -rw-r--r-- | src/db/postgre.ts | 2 | ||||
| -rw-r--r-- | src/db/redis.ts | 27 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/db/elasticsearch.ts b/src/db/elasticsearch.ts index 048e399bdf..58455b510d 100644 --- a/src/db/elasticsearch.ts +++ b/src/db/elasticsearch.ts @@ -1,5 +1,5 @@ import * as elasticsearch from '@elastic/elasticsearch'; -import config from '../config'; +import config from '@/config'; const index = { settings: { diff --git a/src/db/postgre.ts b/src/db/postgre.ts index 831e5e0592..d53d315f7b 100644 --- a/src/db/postgre.ts +++ b/src/db/postgre.ts @@ -3,7 +3,7 @@ const types = require('pg').types; types.setTypeParser(20, Number); import { createConnection, Logger, getConnection } from 'typeorm'; -import config from '../config'; +import config from '@/config'; import { entities as charts } from '../services/chart/entities'; import { dbLogger } from './logger'; import * as highlight from 'cli-highlight'; diff --git a/src/db/redis.ts b/src/db/redis.ts index 41d030149c..a10422846f 100644 --- a/src/db/redis.ts +++ b/src/db/redis.ts @@ -1,12 +1,19 @@ import * as redis from 'redis'; -import config from '../config'; +import config from '@/config'; -export default redis.createClient( - config.redis.port, - config.redis.host, - { - password: config.redis.pass, - prefix: config.redis.prefix, - db: config.redis.db || 0 - } -); +export function createConnection() { + return redis.createClient( + config.redis.port, + config.redis.host, + { + password: config.redis.pass, + prefix: config.redis.prefix, + db: config.redis.db || 0 + } + ); +} + +export const subsdcriber = createConnection(); +subsdcriber.subscribe(config.host); + +export const redisClient = createConnection(); |