Skip to content

Степанов Дмитрий Лаб. 2 Группа 6511#101

Open
negniy wants to merge 12 commits intoitsecd:mainfrom
negniy:main
Open

Степанов Дмитрий Лаб. 2 Группа 6511#101
negniy wants to merge 12 commits intoitsecd:mainfrom
negniy:main

Conversation

@negniy
Copy link
Copy Markdown

@negniy negniy commented Apr 11, 2026

ФИО: Степанов Дмитрий
Номер группы: 6511
Номер лабораторной: 2
Номер варианта: 14
Краткое описание предметной области: Пациенты
Краткое описание добавленных фич: Добавлен кастомный балансировщик (querybased)

@github-actions github-actions bot added In progress Код в процессе проверки Lab 2 Лабораторная №2. Балансировка нагрузки labels Apr 11, 2026
@github-actions github-actions bot requested a review from danlla April 11, 2026 17:30
Comment on lines +9 to +16
public class QueryBasedLoadBalancer : ILoadBalancer
{
private readonly IServiceDiscoveryProvider _serviceDiscovery;

public QueryBasedLoadBalancer(IServiceDiscoveryProvider serviceDiscovery)
{
_serviceDiscovery = serviceDiscovery;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Использовать primary constructor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лишний файл

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Если у этого проекта есть префикс PatientApp, то тогда этот префикс должен быть у всех проектов

Comment on lines +33 to +42
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll", policy =>
{
policy
.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нужно настроить cors так, чтобы в разрешенных origins были только origins клиента

Comment on lines +13 to +23
for (var i = 0; i < 3; ++i)
{
var currGenerator = builder.AddProject<Projects.PatientApp_Generator>($"generator-{i + 1}")
.WithEndpoint("http", endpoint => endpoint.Port = gatewayPort + 1 + i)
.WithReference(redis)
.WaitFor(redis);

gateway
.WithReference(currGenerator)
.WaitFor(currGenerator);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно i начинать итерировать с 1 и тогда + 1 + i и i + 1 превратятся в просто i

Comment on lines +5 to +6
var builder = WebApplication.CreateBuilder(args);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не хватает builder.AddServiceDefaults();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 2 Лабораторная №2. Балансировка нагрузки

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants