allow redis family to be specified as a string #165
Loading…
Reference in a new issue
No description provided.
Delete branch "redis-family-friendly-strings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This makes it consistent withoutgoingAddressFamily
, reducingpotential confusion.
outgoingAddressFamily
removed per #165 (comment).For compatibility reasons, numbers are still permitted for
redis.family
with the following mapping:
dual
=0
ipv4
=4
ipv6
=6
Changelog: Changed
9d1ee11d91
toc994562cce
@ -5,0 +7,4 @@
case 'ipv4': return 4;
case 'ipv6': return 6;
case 'dual': return 0;
default: return family ?? 0;
This does not protect against someone entering another string value, e.g.
IPv4
will cause an error, as willIPv7
. We should probably have a nicer error or warning message (default to dual?) instead of this verbose ioredis error:Do we have any form of validation of the yaml config outside of the few asserts at start time? We could employ ajv here since it's already used in the project (assuming anyone other than me is a fan of it)
AFAIK there's not a whole lot of validation of the config, that error would have also happened with the current code in main as well.
c550270d26
tob7d75feaff
On a sidenote, it seems that
outgoingAddressFamily
isn't actually used anywhere that I could find. So maybe instead of having the separate type declaration you could just remove that from the example config & config type since those seem to be the only places where it is present.b7d75feaff
to8ca544c45d