using System.IO;
using System.Threading;
using bahnplan.web.database;
using LinqToDB.Common;
using LinqToDB.Data;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace bahnplan.web {
	public class Program {
		public static void Main(string[] args) {
			DataConnection.DefaultSettings        = new Database.Settings();
			Configuration.Linq.AllowMultipleQuery = true;
			Directory.CreateDirectory(Variables.TicketDir);
			ThreadPool.SetMinThreads(100,100);
			CreateHostBuilder(args).Build().Run();
		}

		public static IHostBuilder CreateHostBuilder(string[] args) =>
			Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
	}
}