File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ addDefaults(config, {
134
134
} ,
135
135
disableOfflineQueue : true ,
136
136
expiryTime : 24 * 60 * 60 ,
137
+ getTimeout : 40
137
138
}
138
139
} ) ;
139
140
loadFromEnv ( config ) ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as redis from "redis";
4
4
interface RedisConfig extends redis . RedisClientOptions {
5
5
enabled : boolean ;
6
6
expiryTime : number ;
7
+ getTimeout : number ;
7
8
}
8
9
9
10
export interface CustomPostgresConfig extends PoolConfig {
Original file line number Diff line number Diff line change @@ -31,10 +31,9 @@ if (config.redis?.enabled) {
31
31
client . connect ( ) ;
32
32
exportClient = client as RedisSB ;
33
33
34
- const timeoutDuration = 40 ;
35
34
const get = client . get . bind ( client ) ;
36
35
exportClient . get = ( key ) => new Promise ( ( resolve , reject ) => {
37
- const timeout = setTimeout ( ( ) => reject ( ) , timeoutDuration ) ;
36
+ const timeout = setTimeout ( ( ) => reject ( ) , config . redis . getTimeout ) ;
38
37
get ( key ) . then ( ( reply ) => {
39
38
clearTimeout ( timeout ) ;
40
39
resolve ( reply ) ;
You can’t perform that action at this time.
0 commit comments