Белякова Вероника Лаб. 2 Группа 6511#78
Open
Cat-sandwich wants to merge 7 commits intoitsecd:mainfrom
Open
Conversation
danlla
requested changes
Apr 2, 2026
Comment on lines
+7
to
+27
| var generators = new List<IResourceBuilder<ProjectResource>>(); | ||
|
|
||
| for (var i = 1; i <= 3; i++) | ||
| { | ||
| var generator = builder | ||
| .AddProject<Projects.Employee_ApiService>($"generator-{i}") | ||
| .WithReference(redis) | ||
| .WithHttpEndpoint(name: $"http{i}", port: 5200 + i); | ||
|
|
||
| generators.Add(generator); | ||
| } | ||
|
|
||
| var apiGateway = builder.AddProject<Projects.Employee_ApiGateway>("employee-apigateway") | ||
| .WithHttpEndpoint(name: "gateway", port: 5200); | ||
|
|
||
| foreach (var generator in generators) | ||
| { | ||
| apiGateway | ||
| .WithReference(generator) | ||
| .WaitFor(generator); | ||
| } |
There was a problem hiding this comment.
Можно создание apiGateway перенести до цикла с созданием генераторов и тогда не нужны будут generators и цикл
foreach (var generator in generators)
{
apiGateway
.WithReference(generator)
.WaitFor(generator);
}
Comment on lines
+19
to
+27
| builder.Services.AddCors(options => | ||
| { | ||
| options.AddPolicy("wasm", policy => | ||
| { | ||
| policy.AllowAnyOrigin() | ||
| .AllowAnyMethod() | ||
| .AllowAnyHeader(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
В принципе от cors в этом проекте можно избавиться, так как браузер теперь взаимодействует с api gateway
There was a problem hiding this comment.
А сюда нужно добавить cors и настроить его так, чтобы разрешенным origin был клиент
| $"Routes:0:DownstreamHostAndPorts:{i}:Port", uri.Port.ToString())); | ||
| } | ||
|
|
||
| if (overrides.Any()) |
| { | ||
| var generator = builder | ||
| .AddProject<Projects.Employee_ApiService>($"generator-{i}") | ||
| .WithReference(redis) |
There was a problem hiding this comment.
Нужно сюда добавить еще .WaitFor(redis);
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
Номер варианта: 2
Краткое описание предметной области: Сотрудник компании
Краткое описание добавленных фич: Выполнена балансировка нагрузки согласно варианту (алгоритм Query Based)