Redis reads prefer replica

This commit is contained in:
2025-09-15 00:48:15 +01:00
parent a741f25bde
commit 919ab864ce
7 changed files with 15 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ public class AccountRegistrationService
return reply;
}
var registrationsByIp = await _redis.GetAsync<int>("IPREG:" + ip).ConfigureAwait(false);
var registrationsByIp = await _redis.GetAsync<int>("IPREG:" + ip, CommandFlags.PreferReplica).ConfigureAwait(false);
if (registrationsByIp >= _configurationService.GetValueOrDefault(nameof(AuthServiceConfiguration.RegisterIpLimit), 3))
{
reply.ErrorMessage = "Too many registrations from this IP. Please try again later.";