File tree Expand file tree Collapse file tree 9 files changed +75
-43
lines changed
Expand file tree Collapse file tree 9 files changed +75
-43
lines changed Original file line number Diff line number Diff line change 3838 "@tabler/icons-react" : " ^3.34.1" ,
3939 "@upstash/redis" : " ^1.37.0" ,
4040 "bullmq" : " catalog:" ,
41+ "ioredis" : " ^5.8.2" ,
4142 "clsx" : " ^2.1.1" ,
4243 "ffmpeg-static" : " ^5.2.0" ,
4344 "ffprobe-static" : " ^3.1.0" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
22import { ConfigModule } from '@nestjs/config' ;
33import { BullModule } from '@nestjs/bullmq' ;
44import * as path from 'path' ;
5- import { getRedisConnection } from '@repo/config ' ;
5+ import { getRedisConnection } from './redis ' ;
66import { SupabaseModule } from './supabase/supabase.module' ;
77
88import { AppController } from './app.controller' ;
Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ import Redis from 'ioredis';
22
33let sharedConnection : Redis | null = null ;
44
5- const defaultUrl = 'redis://127.0.0.1:6379' ;
6-
75export function getRedisConnection ( ) : Redis {
86 if ( sharedConnection ) return sharedConnection ;
9- const url = process . env . REDIS_URL ?? defaultUrl ;
10- sharedConnection = new Redis ( url , {
7+ sharedConnection = new Redis ( process . env . REDIS_URL ?? 'redis://127.0.0.1:6379' , {
118 maxRetriesPerRequest : null ,
129 enableReadyCheck : false ,
1310 lazyConnect : true ,
Original file line number Diff line number Diff line change 88 "lint" : " echo 'No source JavaScript files to lint'" ,
99 "build" : " tsc -p tsconfig.json"
1010 },
11- "dependencies" : {
12- "ioredis" : " ^5.8.2"
13- },
11+ "dependencies" : {},
1412 "devDependencies" : {
1513 "@repo/typescript-config" : " workspace:*" ,
1614 "eslint" : " ^9.0.0" ,
Original file line number Diff line number Diff line change 1- export * from "./settings/types" ;
2- export * from "./redis" ;
1+ export * from "./settings/types" ;
Original file line number Diff line number Diff line change 88 ],
99 "exports" : {
1010 "." : {
11- "import" : " ./dist/index.js" ,
12- "require" : " ./dist/index.js"
11+ "import" : " ./dist/src/ index.js" ,
12+ "require" : " ./dist/src/ index.js"
1313 }
1414 },
1515 "scripts" : {
3434 "@upstash/redis" : " ^1.37.0" ,
3535 "axios" : " catalog:" ,
3636 "bullmq" : " catalog:" ,
37+ "ioredis" : " ^5.8.2" ,
3738 "jsonrepair" : " ^3.13.0" ,
3839 "reflect-metadata" : " ^0.2.0" ,
3940 "rxjs" : " ^7.8.1"
Original file line number Diff line number Diff line change 1+ import Redis from 'ioredis' ;
2+
3+ let sharedConnection : Redis | null = null ;
4+
5+ export function getRedisConnection ( ) : Redis {
6+ if ( sharedConnection ) return sharedConnection ;
7+ sharedConnection = new Redis ( process . env . REDIS_URL ?? 'redis://127.0.0.1:6379' , {
8+ maxRetriesPerRequest : null ,
9+ enableReadyCheck : false ,
10+ lazyConnect : true ,
11+ } ) ;
12+ return sharedConnection ;
13+ }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
22import { BullModule } from '@nestjs/bullmq' ;
33import { ConfigModule } from '@nestjs/config' ;
44import * as path from 'path' ;
5- import { getRedisConnection } from '@repo/config ' ;
5+ import { getRedisConnection } from './redis ' ;
66import { HealthController } from './health.controller' ;
77import { TrainAiProcessor } from './processor/train-ai.processor' ;
88import { ThumbnailProcessor } from './processor/thumbnail.processor' ;
You can’t perform that action at this time.
0 commit comments