using Microsoft.Extensions.Logging;
using Quartz;

namespace Netina.Core.QuartzServices;

public class SiteMapScheduledJob : IJob
{
    private readonly ILogger<SiteMapScheduledJob> _logger;
    private readonly ISiteMapService _siteMapService;

    public SiteMapScheduledJob(ILogger<SiteMapScheduledJob> logger,ISiteMapService siteMapService)
    {
        _logger = logger;
        _siteMapService = siteMapService;
    }

    public async Task Execute(IJobExecutionContext context)
    {
        await _siteMapService.CreateSiteMapAsync();
        _logger.LogInformation($"Site Map Job Done At : {DateTime.Now}");
    }
}