parseRedisUrl
parseRedisUrl(
url):RedisOptions
Turns a redis:// or rediss:// URL into ioredis options, keeping every
part of it.
The trap this exists for: a connection rebuilt from the URL’s host and port
alone silently drops the password, the username, the db index and TLS. On a
Redis with requirepass every worker connection then fails NOAUTH and all
jobs wedge, while the app’s own Redis client (handed the full URL) works, so
nothing looks wrong until the queue backs up.
Workers need options rather than a client (each Worker opens and closes its own connections), so the URL is parsed once here and every connection is built from the same result.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”RedisOptions