You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue with RedisDistributedLock. Currently, I am using a single Redis instance for multiple environments (such as dev and test). My goal is to use the same key in the TryAcquireLockAsync method but with different prefixes for each environment.
For example, in the application code, I have: _distributedLockProvider.AcquireLockAsync(“DO_SOMETHING”);
However, in Redis, I need the keys to be environment-specific, like dev:DO_SOMETHING for the development environment and test:DO_SOMETHING for the test environment.
As a reference, in StackExchangeRedisCache, this is achieved as follows:
Great. I’ll keep this issue open as a reminder to add a note about this in the documentation
madelson
changed the title
Support for Environment-Specific Key Prefixes in RedisDistributedLock
Document Support for Key Prefixes in RedisDistributedLock
Jan 4, 2024
Hello,
I'm encountering an issue with RedisDistributedLock. Currently, I am using a single Redis instance for multiple environments (such as dev and test). My goal is to use the same key in the TryAcquireLockAsync method but with different prefixes for each environment.
For example, in the application code, I have:
_distributedLockProvider.AcquireLockAsync(“DO_SOMETHING”);
However, in Redis, I need the keys to be environment-specific, like dev:DO_SOMETHING for the development environment and test:DO_SOMETHING for the test environment.
As a reference, in StackExchangeRedisCache, this is achieved as follows:
In this case, InstanceName serves as a prefix.
Would it be a good idea to consider adding an option for this in RedisDistributedSynchronizationOptionsBuilder during startup configuration?
The text was updated successfully, but these errors were encountered: