Skip to content

Commit

Permalink
Rename Worker to IndexWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Jul 10, 2023
1 parent fa2afd0 commit b6c3f40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions TRENZ.Docs.API/Controllers/SearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public class SearchController : ControllerBase

private readonly IIndexingService _indexingService;
private readonly IConfiguration _configuration;
private readonly Worker _worker;
private readonly IndexWorker _indexWorker;

public SearchController(IIndexingService indexingService, IConfiguration configuration, Worker worker)
public SearchController(IIndexingService indexingService, IConfiguration configuration, IndexWorker indexWorker)
{
_indexingService = indexingService;
_configuration = configuration;
_worker = worker;
_indexWorker = indexWorker;
}

[HttpGet]
Expand Down Expand Up @@ -46,6 +46,6 @@ public async Task Reindex([FromQuery] string? key, CancellationToken cancellatio
_lastReindex = DateTime.Now;
#endif

await _worker.DoReindex(cancellationToken);
await _indexWorker.DoReindex(cancellationToken);
}
}
6 changes: 3 additions & 3 deletions TRENZ.Docs.API/Worker.cs → TRENZ.Docs.API/IndexWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

namespace TRENZ.Docs.API
{
public class Worker : BackgroundService
public class IndexWorker : BackgroundService
{
private readonly ILogger<Worker> _logger;
private readonly ILogger<IndexWorker> _logger;
private readonly IConfiguration _configuration;
private readonly IHostApplicationLifetime _lifetime;
private readonly IIndexingService _indexingService;
private readonly ISourcesProvider _sourcesProvider;
private readonly IFileProcessingService _fileProcessingService;
private readonly INavTreeProvider _navTreeProvider;

public Worker(ILogger<Worker> logger, IConfiguration configuration, IHostApplicationLifetime lifetime, IIndexingService indexingService, ISourcesProvider sourcesProvider, IFileProcessingService fileProcessingService, INavTreeProvider navTreeProvider)
public IndexWorker(ILogger<IndexWorker> logger, IConfiguration configuration, IHostApplicationLifetime lifetime, IIndexingService indexingService, ISourcesProvider sourcesProvider, IFileProcessingService fileProcessingService, INavTreeProvider navTreeProvider)
{
_logger = logger;
_configuration = configuration;
Expand Down
4 changes: 2 additions & 2 deletions TRENZ.Docs.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
builder.Services.AddAuthAdapter();
}

builder.Services.AddSingleton<Worker>();
builder.Services.AddHostedService<Worker>(sp => sp.GetRequiredService<Worker>());
builder.Services.AddSingleton<IndexWorker>();
builder.Services.AddHostedService<IndexWorker>(sp => sp.GetRequiredService<IndexWorker>());

builder.Services.AddControllers();

Expand Down

0 comments on commit b6c3f40

Please sign in to comment.