Open
Conversation
Настройка редис и оркестрации
но наконец-то победа
danlla
requested changes
Apr 15, 2026
Comment on lines
+9
to
+16
| public class QueryBasedLoadBalancer : ILoadBalancer | ||
| { | ||
| private readonly IServiceDiscoveryProvider _serviceDiscovery; | ||
|
|
||
| public QueryBasedLoadBalancer(IServiceDiscoveryProvider serviceDiscovery) | ||
| { | ||
| _serviceDiscovery = serviceDiscovery; | ||
| } |
There was a problem hiding this comment.
Если у этого проекта есть префикс PatientApp, то тогда этот префикс должен быть у всех проектов
Comment on lines
+33
to
+42
| builder.Services.AddCors(options => | ||
| { | ||
| options.AddPolicy("AllowAll", policy => | ||
| { | ||
| policy | ||
| .AllowAnyOrigin() | ||
| .AllowAnyHeader() | ||
| .AllowAnyMethod(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Нужно настроить 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); | ||
| } |
There was a problem hiding this comment.
Можно i начинать итерировать с 1 и тогда + 1 + i и i + 1 превратятся в просто i
Comment on lines
+5
to
+6
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
There was a problem hiding this comment.
Не хватает builder.AddServiceDefaults();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ФИО: Степанов Дмитрий
Номер группы: 6511
Номер лабораторной: 2
Номер варианта: 14
Краткое описание предметной области: Пациенты
Краткое описание добавленных фич: Добавлен кастомный балансировщик (querybased)