-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathWorkspaceBootstrapService.cs
More file actions
33 lines (26 loc) · 1.05 KB
/
Copy pathWorkspaceBootstrapService.cs
File metadata and controls
33 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using DecompilerServer.Services;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace DecompilerServer;
public sealed class WorkspaceBootstrapService(
ILogger<WorkspaceBootstrapService> log,
DecompilerWorkspace workspace) : IHostedService
{
private readonly ILogger<WorkspaceBootstrapService> _log = log;
private readonly DecompilerWorkspace _workspace = workspace;
public Task StartAsync(CancellationToken cancellationToken)
{
var registeredAliases = _workspace.ListRegisteredAliases();
if (registeredAliases.Count == 0)
{
_log.LogInformation("No registered workspace aliases found.");
return Task.CompletedTask;
}
_log.LogInformation(
"Registered {Count} workspace aliases for on-demand loading. Current alias: {CurrentAlias}",
registeredAliases.Count,
_workspace.CurrentContextAlias);
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}