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

namespace trainav.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);

		Migrations.RunMigrations();

		CreateHostBuilder(args).Build().Run();
	}

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