Skip to content
GitHub

RedisCooldownStoreOptions

interface in meocord/common Since 4.1.0

interface RedisCooldownStoreOptions

How a RedisCooldownStore names its keys and runs its script.

Members

prefix

prefix?: string

Put before every key the store writes. Defaults to meocord:cooldown:.

evalsha

evalsha?: RedisEvalSha

Runs the script by its SHA1, sending it in full only when the server answers NOSCRIPT: once after each restart or SCRIPT FLUSH. Without it, every call sends the script with EVAL.

hashTag

hashTag?: 'handler'

'handler' puts each handler's keys in one Redis Cluster slot, as {Controller.method}#…, so its stacked cooldowns stay one step on Cluster as they are on one server. Every call to a handler then lands on that one slot, so a busy handler's slot carries all of its traffic. Without it, on Cluster, a handler's cooldowns are each counted by a script of their own, in order. A single server needs neither.