mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-05 06:45:37 +01:00
33 lines
983 B
C#
33 lines
983 B
C#
namespace Giants.Services
|
|
{
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
public class InitializerService : IHostedService
|
|
{
|
|
private readonly IVersioningStore updaterStore;
|
|
private readonly IServerRegistryStore serverRegistryStore;
|
|
|
|
public InitializerService(
|
|
IVersioningStore updaterStore,
|
|
IServerRegistryStore serverRegistryStore)
|
|
{
|
|
// TODO: Pick these up from reflection and auto initialize
|
|
this.updaterStore = updaterStore;
|
|
this.serverRegistryStore = serverRegistryStore;
|
|
}
|
|
|
|
public async Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
await this.serverRegistryStore.Initialize();
|
|
await this.updaterStore.Initialize();
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
}
|