diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-09-18 03:27:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-18 03:27:08 +0900 |
| commit | b75184ec8e3436200bacdcd832e3324702553d20 (patch) | |
| tree | 8b7e316f29e95df921db57289c8b8da476d18f07 /packages/backend/src/redis.ts | |
| parent | Update ROADMAP.md (diff) | |
| download | misskey-b75184ec8e3436200bacdcd832e3324702553d20.tar.gz misskey-b75184ec8e3436200bacdcd832e3324702553d20.tar.bz2 misskey-b75184ec8e3436200bacdcd832e3324702553d20.zip | |
なんかもうめっちゃ変えた
Diffstat (limited to 'packages/backend/src/redis.ts')
| -rw-r--r-- | packages/backend/src/redis.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/backend/src/redis.ts b/packages/backend/src/redis.ts new file mode 100644 index 0000000000..d1678ae65f --- /dev/null +++ b/packages/backend/src/redis.ts @@ -0,0 +1,15 @@ +import Redis from 'ioredis'; +import { loadConfig } from '@/config.js'; + +export function createRedisConnection(): Redis.Redis { + const config = loadConfig(); + + return new Redis({ + port: config.redis.port, + host: config.redis.host, + family: config.redis.family == null ? 0 : config.redis.family, + password: config.redis.pass, + keyPrefix: `${config.redis.prefix}:`, + db: config.redis.db ?? 0, + }); +} |