Skip to content

Commit

Permalink
Change structure for elasticsearch settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergii Novytskyi committed Jan 14, 2022
1 parent 0c2b00f commit 218fe88
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace OutOfSchool.WebApi.Config
using Microsoft.Extensions.Configuration;

namespace OutOfSchool.WebApi.Config
{
public class ElasticsearchSynchronizationSchedulerConfig
{
public const string Name = "ElasticsearchSynchronizationScheduler";
public static string SectionName { get; } = ElasticConfig.Name + ConfigurationPath.KeyDelimiter + "SynchronizationScheduler";

public int OperationsPerTask { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion OutOfSchool/OutOfSchool.WebApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddTransient<IElasticsearchService<WorkshopES, WorkshopFilterES>, ESWorkshopService>();

services.AddElasticsearchSynchronization(
builder => builder.Bind(Configuration.GetSection(ElasticsearchSynchronizationSchedulerConfig.Name)));
builder => builder.Bind(Configuration.GetSection(ElasticsearchSynchronizationSchedulerConfig.SectionName)));

// entities services
services.AddTransient<IAddressService, AddressService>();
Expand Down
6 changes: 5 additions & 1 deletion OutOfSchool/OutOfSchool.WebApi/appsettings.Compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"http://elasticsearch:9200/"
],
"User": "admin",
"Password": "admin"
"Password": "admin",
"SynchronizationScheduler": {
"OperationsPerTask": 10,
"DelayBetweenTasksInMilliseconds": 60000
}
}
}
7 changes: 1 addition & 6 deletions OutOfSchool/OutOfSchool.WebApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,5 @@
"Release3": false
},

"MySQLServerVersion": "8.0.27",

"ElasticsearchSynchronizationScheduler": {
"OperationsPerTask": 10,
"DelayBetweenTasksInMilliseconds": 60000
}
"MySQLServerVersion": "8.0.27"
}

0 comments on commit 218fe88

Please sign in to comment.