fix(api): заполнение данных о пользователе в кэше
This commit is contained in:
@@ -66,11 +66,19 @@ namespace PARR.API.Services.Implementations
|
||||
var cacheData = new UserCache
|
||||
{
|
||||
UserIp = ipAddress,
|
||||
Roles = roles,
|
||||
Name = user!.Name,
|
||||
Description = user.Description ?? string.Empty
|
||||
Roles = roles
|
||||
};
|
||||
|
||||
if (host != null)
|
||||
cacheData.Name = host.Ek;
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
cacheData.Name = user.Name + host != null ? $", {host!.Ek}" : string.Empty;
|
||||
cacheData.Description = user.Description ?? string.Empty;
|
||||
}
|
||||
|
||||
|
||||
await cacheService.SetCachedDataAsync(GetAllowKey(ipAddress), cacheData, userCacheSettings.UserCacheTtl);
|
||||
|
||||
return cacheData;
|
||||
|
||||
Reference in New Issue
Block a user