using UniVerse.Infrastructure.Data;

namespace UniVerse.Api.BackgroundServices;

public class AchievementCatalogHostedService : IHostedService
{
    private readonly IServiceProvider _services;

    public AchievementCatalogHostedService(IServiceProvider services) => _services = services;

    public async Task StartAsync(CancellationToken cancellationToken)
    {
        await AchievementCatalogSeeder.SeedAsync(_services, cancellationToken);
    }

    public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
