File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ var RedisStore = function(options) {
16
16
17
17
var setExpire = function ( replies , rdskey ) {
18
18
// if this is new or has no expiry
19
- if ( options . resetExpiryOnChange || replies [ 0 ] === 1 || replies [ 1 ] === - 1 ) {
20
- // then expire it after the timeout
21
- options . client . pexpire ( rdskey , expiryMs ) ;
22
- }
19
+ if ( options . resetExpiryOnChange || replies [ 0 ] === 1 || replies [ 1 ] === - 1 ) {
20
+ // then expire it after the timeout
21
+ options . client . pexpire ( rdskey , expiryMs ) ;
22
+ return expiryMs ;
23
+ } else {
24
+ return replies [ 1 ] ;
25
+ }
23
26
} ;
24
27
25
28
var processReplies = function ( replies ) {
@@ -47,9 +50,9 @@ var RedisStore = function(options) {
47
50
}
48
51
49
52
replies = processReplies ( replies ) ;
50
- setExpire ( replies , rdskey ) ;
53
+ var ttl = setExpire ( replies , rdskey ) ;
51
54
52
- cb ( null , replies [ 0 ] ) ;
55
+ cb ( null , replies [ 0 ] , ttl > 0 ? new Date ( new Date ( ) . getTime ( ) + ttl ) : null ) ;
53
56
} ) ;
54
57
} ;
55
58
You can’t perform that action at this time.
0 commit comments