Merge pull request #33630 from sbutler2901/connect-redis-ttl

@types/connect-redis RedisStore ttl function support
This commit is contained in:
Gabriela Britto
2019-03-08 13:16:32 -08:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -6,5 +6,8 @@ const store = new RedisStore({
host: 'localhost',
port: 6379,
logErrors: error => console.warn(error),
scanCount: 80,
scanCount: 80,
ttl: (store, sess, sessionID) => {
return 60;
}
});
+2 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for connect-redis
// Project: https://npmjs.com/package/connect-redis
// Definitions by: Xavier Stouder <https://github.com/xstoudi>
// Seth Butler <https://github.com/sbutler2901>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -26,7 +27,7 @@ declare module "connect-redis" {
port?: number;
socket?: string;
url?: string;
ttl?: number;
ttl?: number | string | ((store: RedisStore, sess: Express.SessionData, sid: string) => number);
disableTTL?: boolean;
db?: number;
pass?: string;