using BLWLogProduce.Services;

namespace BLWLogProduce
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = WebApplication.CreateBuilder(args);

            // Add services to the container.

            builder.Services.AddControllers();
            builder.Services.AddHostedService<KafkaProduce>();
            builder.Services.AddHostedService<MyTimer>();

            builder.Services.AddMemoryCache((option)=> { });
            //builder.UseOrleans(ooo =>
            //{
            //    ooo.UseLocalhostClustering();
            //    ooo.AddRedisGrainStorage("redis-store", options =>
            //    {
            //        options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions
            //        {
            //            EndPoints = { "127.0.0.1:6379" },
            //            AbortOnConnectFail = true,
            //            ConnectRetry = 5,
            //            ConnectTimeout = 15000,
            //            SyncTimeout = 15000
            //        };
            //    });
            //});
                 
            var app = builder.Build();

            // Configure the HTTP request pipeline.

            app.UseHttpsRedirection();

            app.UseAuthorization();


            app.MapControllers();

            app.Run();
        }
    }
}
