@@ -9,30 +9,33 @@ const RedisStore = require("../../component/connector/redis");
99 * An existing connection to a redis instance.
1010 * If this passed, it is used to connect to the Redis server.
1111 * Otherwise, we try to connect to a Redis server using the
12- * options.credentials .
12+ * other options.
1313 * @param {Object } [options.credentials] (optional):
1414 * Credentials for establishing a connection to a Redis server.
15- * @param {String } [options.credentials. host]: the server host
16- * @param {Number } [options.credentials. port]: the server port
17- * @param {String } [options.credentials. username]: the server username
18- * @param {String } [options.credentials. password]: the server user password
19- * @param {String } [options.credentials. db]: the database to connect to
20- * @param {String } [options.credentials. url]: full DSN of the Redis server
21- * If the [options.credentials. url] is set, it is used instead
15+ * @param {String } [options.host]: the server host
16+ * @param {Number } [options.port]: the server port
17+ * @param {String } [options.username]: the server username
18+ * @param {String } [options.password]: the server user password
19+ * @param {String } [options.db]: the database to connect to
20+ * @param {String } [options.url]: full DSN of the Redis server
21+ * If the [options.url] is set, it is used instead
2222 * and the other credential options are ignored.
23+ * @param {Boolean } [options.autoConnect]
24+ * @param {Boolean } [options.legacyMode]
25+ * @param {Boolean } [options.exitOnConnectionFailure]
2326 * @param {Number } [options.maxConnectionAttempts]: The maximum number of times
2427 * to attempt connecting before exiting.
2528 * @return {Object } with methods: set(), get(), unset(), contains(), and client().
2629 */
2730module . exports = function createRedisStore ( options ) {
28- const { connection, credentials } = options || { } ;
31+ const { connection, ... rest } = options || { } ;
2932
3033 let store ;
3134
3235 if ( connection && typeof connection === "object" ) {
3336 store = connection ;
34- } else if ( credentials && typeof credentials === "object" ) {
35- const redisStore = new RedisStore ( credentials ) ;
37+ } else {
38+ const redisStore = new RedisStore ( { ... rest } ) ;
3639 store = redisStore . getClient ( ) ;
3740
3841 setTimeout ( async function ( ) {
0 commit comments