public DashboardHub(DarkStatsDbContext darkStatsDbContext, SettingsLib settings, IHubContext <DashboardHub> clients) { _context = darkStatsDbContext; _settings = settings; _clients = clients; _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; }
public Dashboard(DarkStatsDbContext darkStatsDbContext, SettingsLib settings, IHubContext <DashboardHub> clients) { _context = darkStatsDbContext; _settings = settings; _clients = clients; DashboardScrape.DataGathered += DataGatheredEvent; Scraper.ScrapeSaved += ScrapeSavedEvent; _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; }
public static void Main(string[] args) { if (args.Length == 1) { _listenUrl = args[0]; Console.WriteLine("Using listen address: " + _listenUrl); } Console.WriteLine("Starting DarkStatsCore ({0})...", SettingsLib.VersionInformation); using (var context = new DarkStatsDbContext()) { context.Database.Migrate(); var settings = new SettingsLib(context); if (!settings.InvalidSettings) { ScrapeTask.StartScrapeTask(settings.SaveTime, settings.Url); } } BuildWebHost(args).Run(); }
public static int Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Console(theme: AnsiConsoleTheme.Code, standardErrorFromLevel: LogEventLevel.Warning) .CreateLogger(); Serilog.Debugging.SelfLog.Enable(Console.Error); try { if (args.Length == 1) { _listenUrl = args[0]; Log.Information("Using listen address: {ListenUrl}", _listenUrl); } Log.Information("Starting DarkStatsCore ({Version})...", SettingsLib.VersionInformation); using (var context = new DarkStatsDbContext()) { context.Database.Migrate(); var settings = new SettingsLib(context); if (!settings.InvalidSettings) { ScrapeTask.StartScrapeTask(settings.SaveTime, settings.Url); } } BuildWebHost(args).Run(); return(0); } catch (Exception e) { Log.Fatal(e, "Host terminated unexpectedly"); return(1); } finally { Log.CloseAndFlush(); } }
public SettingsPageModel(SettingsLib settings) { _settings = settings; }
public IndexModel(SettingsLib settings) { _settings = settings; SaveTime = _settings.SaveTime.TotalMilliseconds; }