mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-05 06:45:37 +01:00
31 lines
792 B
C#
31 lines
792 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Giants.Services;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace Giants.WebApi
|
|
{
|
|
public class InitializerHostedService : IHostedService
|
|
{
|
|
private readonly IServerRegistryStore serverRegistryStore;
|
|
|
|
public InitializerHostedService(IServerRegistryStore serverRegistryStore)
|
|
{
|
|
this.serverRegistryStore = serverRegistryStore;
|
|
}
|
|
|
|
public async Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
await this.serverRegistryStore.Initialize();
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken)
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
}
|