﻿using System;
using System.Threading.Tasks;
using FilterLists.Agent.AppSettings;
using FilterLists.Agent.Extensions;
using FilterLists.Agent.Features.Lists;
using FilterLists.Agent.Features.Urls;
using FilterLists.Agent.Features.Urls.Models.DataFileUrls;
using MediatR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace FilterLists.Agent
{
    public static class Program
    {
        private static IServiceProvider _serviceProvider;

        public static async Task Main()
        {
            BuildServiceProvider();
            var mediator = _serviceProvider.GetService<IOptions<GitHub>>().Value;
            Console.WriteLine(mediator.ProductHeaderValue);
            //await mediator.Send(new CaptureLists.Command());
            //await mediator.Send(new ValidateAllUrls.Command());
        }

        private static void BuildServiceProvider()
        {
            var serviceCollection = new ServiceCollection();
            serviceCollection.RegisterAgentServices();
            _serviceProvider = serviceCollection.BuildServiceProvider();
        }
    }
}
﻿using System;
using System.Threading.Tasks;
using FilterLists.Agent.Extensions;
using FilterLists.Agent.Features.Lists;
using FilterLists.Agent.Features.Urls;
using MediatR;
using Microsoft.Extensions.DependencyInjection;

namespace FilterLists.Agent
{
    public static class Program
    {
        private static IServiceProvider _serviceProvider;

        public static async Task Main()
        {
            BuildServiceProvider();
            var mediator = _serviceProvider.GetService<IMediator>();
            await mediator.Send(new CaptureLists.Command());
            await mediator.Send(new ValidateAllUrls.Command());
        }

        private static void BuildServiceProvider()
        {
            var serviceCollection = new ServiceCollection();
            serviceCollection.RegisterAgentServices();
            _serviceProvider = serviceCollection.BuildServiceProvider();
        }
    }
}
Revert "TEMP: test env vars on prod"
Revert "TEMP: test env vars on prod"

This reverts commit 4d177274d48888d1b38880b3af89b1d515dfb1cf.
