using System; using System.Threading.Tasks; using Autofac; using Microsoft.Extensions.Configuration; using PluralKit.Core; namespace PluralKit.ScheduledTasks { class Startup { static async Task Main(string[] args) { // Load configuration and run global init stuff var config = InitUtils.BuildConfiguration(args).Build(); InitUtils.InitStatic(); var services = BuildContainer(config); services.Resolve().Run(); await Task.Delay(-1); } private static IContainer BuildContainer(IConfiguration config) { var builder = new ContainerBuilder(); builder.RegisterInstance(config); builder.RegisterModule(new ConfigModule()); builder.RegisterModule(new LoggingModule("ScheduledTasks")); builder.RegisterModule(new MetricsModule()); builder.RegisterModule(); builder.RegisterType().AsSelf().SingleInstance(); return builder.Build(); } } }