diff --git a/package.json b/package.json index 400dee4..799fc47 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "autoprefixer": "^10.4.20", "debug": "^4.3.6", "express": "^4.19.2", - "ioredis": "^5.0.0", + "ioredis": "^5.4.2", "next": "^15.1.3", "next-themes": "^0.4.4", "next-view-transitions": "^0.3.4", @@ -57,7 +57,6 @@ }, "devDependencies": { "@types/debug": "^4.1.12", - "@types/ioredis": "^5.0.0", "@types/node": "^22.10.2", "@types/react": "^19.0.2", "@typescript-eslint/eslint-plugin": "^8.18.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a7e73b..6267837 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ dependencies: specifier: ^4.19.2 version: 4.21.2 ioredis: - specifier: ^5.0.0 + specifier: ^5.4.2 version: 5.4.2 next: specifier: ^15.1.3 @@ -73,9 +73,6 @@ devDependencies: '@types/debug': specifier: ^4.1.12 version: 4.1.12 - '@types/ioredis': - specifier: ^5.0.0 - version: 5.0.0 '@types/node': specifier: ^22.10.2 version: 22.10.5 @@ -408,6 +405,7 @@ packages: /@ioredis/commands@1.2.0: resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} + dev: false /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -644,15 +642,6 @@ packages: resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} dev: false - /@types/ioredis@5.0.0: - resolution: {integrity: sha512-zJbJ3FVE17CNl5KXzdeSPtdltc4tMT3TzC6fxQS0sQngkbFZ6h+0uTafsRqu+eSLIugf6Yb0Ea0SUuRr42Nk9g==} - deprecated: This is a stub types definition. ioredis provides its own type definitions, so you do not need this installed. - dependencies: - ioredis: 5.4.2 - transitivePeerDependencies: - - supports-color - dev: true - /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true @@ -1244,6 +1233,7 @@ packages: /cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} + dev: false /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} @@ -1460,6 +1450,7 @@ packages: /denque@2.1.0: resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} + dev: false /depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} @@ -2526,6 +2517,7 @@ packages: standard-as-callback: 2.1.0 transitivePeerDependencies: - supports-color + dev: false /ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} @@ -2987,9 +2979,11 @@ packages: /lodash.defaults@4.2.0: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + dev: false /lodash.isarguments@3.1.0: resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} + dev: false /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -3688,12 +3682,14 @@ packages: /redis-errors@1.2.0: resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} engines: {node: '>=4'} + dev: false /redis-parser@3.0.0: resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} engines: {node: '>=4'} dependencies: redis-errors: 1.2.0 + dev: false /reflect.getprototypeof@1.0.6: resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} @@ -4052,6 +4048,7 @@ packages: /standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + dev: false /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} diff --git a/src/channel.ts b/src/channel.ts index 8d7568c..c22c352 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -209,7 +209,7 @@ export class MemoryChannelRepo implements ChannelRepo { } export class RedisChannelRepo implements ChannelRepo { - client: Redis.Redis + client: Redis constructor() { this.client = getRedisClient() diff --git a/src/redisClient.ts b/src/redisClient.ts index 6bf3aaa..6383758 100644 --- a/src/redisClient.ts +++ b/src/redisClient.ts @@ -2,11 +2,13 @@ import Redis from 'ioredis' export { Redis } -let redisClient: Redis.Redis | null = null +let redisClient: Redis | null = null -export function getRedisClient(): Redis.Redis { +export function getRedisClient(): Redis { if (!redisClient) { - redisClient = new Redis(process.env.REDIS_URL) + redisClient = process.env.REDIS_URL + ? new Redis(process.env.REDIS_URL) + : new Redis() } return redisClient }