Skip to content

Commit

Permalink
fix(storage): use inner ioredis to ignore self-signed cert (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
potb authored Oct 25, 2024
1 parent 49a209a commit 8ade507
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"cheerio": "1.0.0-rc.12",
"cron": "3.1.7",
"discord.js": "14.15.3",
"ioredis": "5.4.1",
"keyv": "4.5.4",
"nanoid": "5.0.7",
"open-graph-scraper": "6.5.2",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/core/cache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@keyv/redis';

import KeyvRedis from '@keyv/redis';
import Redis from 'ioredis';
import Keyv from 'keyv';

import type { Frequency } from '../modules/recurringMessage/recurringMessage.helpers';
Expand Down Expand Up @@ -28,7 +28,9 @@ interface CacheEntries {
}

class CacheImpl implements Cache<CacheEntries> {
private readonly backend = new Keyv(env.redisUrl);
private readonly redis = new Redis(env.redisUrl, { tls: { rejectUnauthorized: false } });

private readonly backend = new Keyv({ store: new KeyvRedis(this.redis) });

public get<Key extends keyof CacheEntries>(key: Key): Promise<CacheEntries[Key] | undefined>;
public get<Key extends keyof CacheEntries>(
Expand Down

0 comments on commit 8ade507

Please sign in to comment.