Skip to content

Кадников Егор Лаб. 1 Группа 6513#4

Open
acebiscuits wants to merge 5 commits intoitsecd:mainfrom
acebiscuits:dev-branch
Open

Кадников Егор Лаб. 1 Группа 6513#4
acebiscuits wants to merge 5 commits intoitsecd:mainfrom
acebiscuits:dev-branch

Conversation

@acebiscuits
Copy link

ФИО: Кадников Егор
Номер группы: 6513
Номер лабораторной: 1
Номер варианта: 41
Краткое описание предметной области: Генератор кредитной заявки
Краткое описание добавленных фич: Добавлен сервис генерации и кеширования кредитной заявки.

@github-actions github-actions bot added In progress Код в процессе проверки Lab 1 Лабораторная №1. Кэширование labels Feb 17, 2026
@github-actions github-actions bot requested a review from alxmcs February 17, 2026 09:05
private async Task RequestNewData()
{
var baseAddress = Configuration["BaseAddress"] ?? throw new KeyNotFoundException("Конфигурация клиента не содержит параметра BaseAddress");
Console.WriteLine($"{baseAddress}?id={Id}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для отладки в блазорном клиенте можно пользоваться брейкпоинтами, как и в любом другом дотнетном проекте. А это позорище надо убрать


var builder = DistributedApplication.CreateBuilder(args);

var redis = builder.AddRedis("redis");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавить контейнер с вебмордой к редису

Comment on lines 7 to 9
var generator = builder.AddProject<Projects.Generator>("generator").WithReference(redis);

var client = builder.AddProject<Projects.Client_Wasm>("client").WithReference(generator);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавить WaitFor() в конфигурации служб. Кому кого надо ждать, думаю, догадаешься самостоятельно

Comment on lines 14 to 15
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.1.1" />
<PackageReference Include="Aspire.Hosting.Redis" Version="13.1.1" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы посоветовал на всякий случай синхронизировать версию сдк и версию нугет пакетов

Comment on lines 12 to 19
private readonly ILogger<CreditOrderController> _logger;
private readonly CreditOrderService _service;

public CreditOrderController(CreditOrderService service, ILogger<CreditOrderController> logger)
{
_service = service;
_logger = logger;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Использовать праймари конструктор


private static readonly DistributedCacheEntryOptions _cacheOptions = new()
{
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Этот параметр захардкожен
  2. Этого параметра недостаточно даже для отладки в аспаере


<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.5" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.3" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно юзать аспаеровский нугет пакет
У тебя нет телеметрии для клиента редиса. Вот, например твой трейс:
Image
А вот трейс для проекта, в котором используется Aspire.StackExchange.Redis.DistributedCaching
Image

// Add services to the container.

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну дефолтные комментарии хотя бы потер бы

Comment on lines 18 to 20
.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отличная конфигурация корса, очень надежная (нет)

Comment on lines 23 to 27
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = builder.Configuration.GetConnectionString("redis");
options.InstanceName = "generator:";
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Соответственно, при использовании аспаеровской клиентской библиотеки этот вызов должен смениться на builder.AddRedisDistributedCache

@acebiscuits acebiscuits requested a review from alxmcs February 19, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 1 Лабораторная №1. Кэширование

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments