GramIO API Reference / storage-redis/ioredis / RedisStorageOptions
Interface: RedisStorageOptions
Defined in: storage-redis/ioredis.d.ts:4
Extends
RedisOptions
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
$ttl? | number | time to live in seconds | - | storage-redis/ioredis.d.ts:6 |
autoPipeliningIgnoredCommands? | string[] | Default [] | RedisOptions.autoPipeliningIgnoredCommands | ioredis/built/redis/RedisOptions.d.ts:156 |
autoResendUnfulfilledCommands? | boolean | Whether or not to resend unfulfilled commands on reconnect. Unfulfilled commands are most likely to be blocking commands such as brpop or blpop. Default true | RedisOptions.autoResendUnfulfilledCommands | ioredis/built/redis/RedisOptions.d.ts:89 |
autoResubscribe? | boolean | When the client reconnects, channels subscribed in the previous connection will be resubscribed automatically if autoResubscribe is true. Default true | RedisOptions.autoResubscribe | ioredis/built/redis/RedisOptions.d.ts:83 |
blockingTimeout? | number | Enables client-side timeout protection for blocking commands when set to a positive number. If blockingTimeout is undefined, 0, or negative (e.g. -1), the protection is disabled and no client-side timers are installed for blocking commands. | RedisOptions.blockingTimeout | ioredis/built/redis/RedisOptions.d.ts:20 |
blockingTimeoutGrace? | number | Grace period (ms) added to blocking command timeouts. Only used when blockingTimeout is a positive number. Defaults to 100ms. | RedisOptions.blockingTimeoutGrace | ioredis/built/redis/RedisOptions.d.ts:25 |
clientInfoTag? | string | Tag to append to the library name in CLIENT SETINFO (ioredis(tag)). Link https://redis.io/docs/latest/commands/client-setinfo/ Default undefined | RedisOptions.clientInfoTag | ioredis/built/redis/RedisOptions.d.ts:62 |
commandQueue? | boolean | - | RedisOptions.commandQueue | ioredis/built/redis/RedisOptions.d.ts:158 |
commandTimeout? | number | If a command does not return a reply within a set number of milliseconds, a "Command timed out" error will be thrown. | RedisOptions.commandTimeout | ioredis/built/redis/RedisOptions.d.ts:13 |
connectionName? | string | Set the name of the connection to make it easier to identity the connection in client list. Link https://redis.io/commands/client-setname | RedisOptions.connectionName | ioredis/built/redis/RedisOptions.d.ts:50 |
Connector? | ConnectorConstructor | - | RedisOptions.Connector | ioredis/built/redis/RedisOptions.d.ts:7 |
connectTimeout? | number | How long the client will wait before killing a socket due to inactivity during initial connection. Default 10000 | RedisOptions.connectTimeout | ioredis/built/redis/RedisOptions.d.ts:126 |
db? | number | Database index to use. Default 0 | RedisOptions.db | ioredis/built/redis/RedisOptions.d.ts:77 |
disableClientInfo? | boolean | If true, skips setting library info via CLIENT SETINFO. Link https://redis.io/docs/latest/commands/client-setinfo/ Default false | RedisOptions.disableClientInfo | ioredis/built/redis/RedisOptions.d.ts:56 |
disconnectTimeout? | number | - | RedisOptions.disconnectTimeout | ioredis/built/connectors/SentinelConnector/index.d.ts:41 |
enableAutoPipelining? | boolean | Default false | RedisOptions.enableAutoPipelining | ioredis/built/redis/RedisOptions.d.ts:152 |
enableOfflineQueue? | boolean | By default, if the connection to Redis server has not been established, commands are added to a queue and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means the Redis server has loaded the database from disk, otherwise means the connection to the Redis server has been established). If this option is false, when execute the command when the connection isn't ready, an error will be returned. Default true | RedisOptions.enableOfflineQueue | ioredis/built/redis/RedisOptions.d.ts:169 |
enableReadyCheck? | boolean | The client will sent an INFO command to check whether the server is still loading data from the disk ( which happens when the server is just launched) when the connection is established, and only wait until the loading process is finished before emitting the ready event. Default true | RedisOptions.enableReadyCheck | ioredis/built/redis/RedisOptions.d.ts:177 |
enableTLSForSentinelMode? | boolean | - | RedisOptions.enableTLSForSentinelMode | ioredis/built/connectors/SentinelConnector/index.d.ts:43 |
failoverDetector? | boolean | - | RedisOptions.failoverDetector | ioredis/built/connectors/SentinelConnector/index.d.ts:51 |
family? | number | - | RedisOptions.family | @types/node/net.d.ts:53 |
host? | string | - | RedisOptions.host | @types/node/net.d.ts:49 |
keepAlive? | number | Enable/disable keep-alive functionality. Link https://nodejs.org/api/net.html#socketsetkeepaliveenable-initialdelay Default 0 | RedisOptions.keepAlive | ioredis/built/redis/RedisOptions.d.ts:38 |
keyPrefix? | string | - | RedisOptions.keyPrefix | ioredis/built/utils/Commander.d.ts:5 |
lazyConnect? | boolean | When a Redis instance is initialized, a connection to the server is immediately established. Set this to true will delay the connection to the server until the first command is sent or redis.connect() is called explicitly. When redis.connect() is called explicitly, a Promise is returned, which will be resolved when the connection is ready or rejected when it fails. The rejection should be handled by the user. Default false | RedisOptions.lazyConnect | ioredis/built/redis/RedisOptions.d.ts:186 |
maxLoadingRetryTime? | number | Default 10000 | RedisOptions.maxLoadingRetryTime | ioredis/built/redis/RedisOptions.d.ts:148 |
maxRetriesPerRequest? | number | The commands that don't get a reply due to the connection to the server is lost are put into a queue and will be resent on reconnect (if allowed by the retryStrategy option). This option is used to configure how many reconnection attempts should be allowed before the queue is flushed with a MaxRetriesPerRequestError error. Set this options to null instead of a number to let commands wait forever until the connection is alive again. Default 20 | RedisOptions.maxRetriesPerRequest | ioredis/built/redis/RedisOptions.d.ts:144 |
monitor? | boolean | This option is used internally when you call redis.monitor() to tell Redis to enter the monitor mode when the connection is established. Default false | RedisOptions.monitor | ioredis/built/redis/RedisOptions.d.ts:133 |
name? | string | Master group name of the Sentinel | RedisOptions.name | ioredis/built/connectors/SentinelConnector/index.d.ts:28 |
natMap? | NatMap | - | RedisOptions.natMap | ioredis/built/connectors/SentinelConnector/index.d.ts:45 |
noDelay? | boolean | Enable/disable the use of Nagle's algorithm. Link https://nodejs.org/api/net.html#socketsetnodelaynodelay Default true | RedisOptions.noDelay | ioredis/built/redis/RedisOptions.d.ts:44 |
offlineQueue? | boolean | - | RedisOptions.offlineQueue | ioredis/built/redis/RedisOptions.d.ts:157 |
password? | string | If set, client will send AUTH command with the value of this option when connected. | RedisOptions.password | ioredis/built/redis/RedisOptions.d.ts:71 |
path? | string | - | RedisOptions.path | @types/node/net.d.ts:69 |
port? | number | - | RedisOptions.port | @types/node/net.d.ts:48 |
preferredSlaves? | PreferredSlaves | - | RedisOptions.preferredSlaves | ioredis/built/connectors/SentinelConnector/index.d.ts:39 |
readOnly? | boolean | Default false | RedisOptions.readOnly | ioredis/built/redis/RedisOptions.d.ts:115 |
reconnectOnError? | ReconnectOnError | Whether or not to reconnect on certain Redis errors. This options by default is null, which means it should never reconnect on Redis errors. You can pass a function that accepts an Redis error, and returns: - true or 1 to trigger a reconnection. - false or 0 to not reconnect. - 2 to reconnect and resend the failed command (who triggered the error) after reconnection. Example const redis = new Redis({ reconnectOnError(err) { const targetError = "READONLY"; if (err.message.includes(targetError)) { // Only reconnect when the error contains "READONLY" return true; // or return 1; } }, }); Default null | RedisOptions.reconnectOnError | ioredis/built/redis/RedisOptions.d.ts:111 |
retryStrategy? | (times) => number | void | - | RedisOptions.retryStrategy | ioredis/built/redis/RedisOptions.d.ts:8 |
role? | "master" | "slave" | Default "master" | RedisOptions.role | ioredis/built/connectors/SentinelConnector/index.d.ts:32 |
scripts? | Record<string, { lua: string; numberOfKeys?: number; readOnly?: boolean; }> | Default undefined | RedisOptions.scripts | ioredis/built/redis/RedisOptions.d.ts:190 |
sentinelCommandTimeout? | number | - | RedisOptions.sentinelCommandTimeout | ioredis/built/connectors/SentinelConnector/index.d.ts:42 |
sentinelMaxConnections? | number | Default 10 | RedisOptions.sentinelMaxConnections | ioredis/built/connectors/SentinelConnector/index.d.ts:50 |
sentinelPassword? | string | - | RedisOptions.sentinelPassword | ioredis/built/connectors/SentinelConnector/index.d.ts:35 |
sentinelReconnectStrategy? | (retryAttempts) => number | void | - | RedisOptions.sentinelReconnectStrategy | ioredis/built/connectors/SentinelConnector/index.d.ts:38 |
sentinelRetryStrategy? | (retryAttempts) => number | void | - | RedisOptions.sentinelRetryStrategy | ioredis/built/connectors/SentinelConnector/index.d.ts:37 |
sentinels? | Partial<SentinelAddress>[] | - | RedisOptions.sentinels | ioredis/built/connectors/SentinelConnector/index.d.ts:36 |
sentinelTLS? | ConnectionOptions | - | RedisOptions.sentinelTLS | ioredis/built/connectors/SentinelConnector/index.d.ts:44 |
sentinelUsername? | string | - | RedisOptions.sentinelUsername | ioredis/built/connectors/SentinelConnector/index.d.ts:34 |
showFriendlyErrorStack? | boolean | - | RedisOptions.showFriendlyErrorStack | ioredis/built/utils/Commander.d.ts:6 |
socketTimeout? | number | If the socket does not receive data within a set number of milliseconds: 1. the socket is considered "dead" and will be destroyed 2. the client will reject any running commands (altought they might have been processed by the server) 3. the reconnect strategy will kick in (depending on the configuration) | RedisOptions.socketTimeout | ioredis/built/redis/RedisOptions.d.ts:32 |
stringNumbers? | boolean | When enabled, numbers returned by Redis will be converted to JavaScript strings instead of numbers. This is necessary if you want to handle big numbers (above Number.MAX_SAFE_INTEGER === 2^53). Default false | RedisOptions.stringNumbers | ioredis/built/redis/RedisOptions.d.ts:121 |
tls? | ConnectionOptions | - | RedisOptions.tls | ioredis/built/connectors/SentinelConnector/index.d.ts:33 |
updateSentinels? | boolean | - | RedisOptions.updateSentinels | ioredis/built/connectors/SentinelConnector/index.d.ts:46 |
username? | string | If set, client will send AUTH command with the value of this option as the first argument when connected. This is supported since Redis 6. | RedisOptions.username | ioredis/built/redis/RedisOptions.d.ts:67 |