public DatabaseHouseKeeper(Storage storage, RequestLimiter requestLimiter, IAPIProvider apiProvider, IBeatmapSearchEngineProvider searchEngine, BeatmapDownloader beatmapDownloader, DbContextPool <PisstaubeDbContext> dbContextPool) : base(storage, requestLimiter, apiProvider, searchEngine, beatmapDownloader, dbContextPool) { _requestLimiter = requestLimiter; _apiProvider = apiProvider; _dbContextPool = dbContextPool; _searchEngine = searchEngine; }
public OsuCrawler(Storage storage, RequestLimiter requestLimiter, IAPIProvider apiProvider, IBeatmapSearchEngineProvider searchEngine, BeatmapDownloader beatmapDownloader, DbContextPool <PisstaubeDbContext> dbContextPool) { _storage = storage; _beatmapDownloader = beatmapDownloader; _dbContextPool = dbContextPool; SearchEngine = searchEngine; ApiProvider = apiProvider; RequestLimiter = requestLimiter; }
public SetDownloader(Storage storage, IAPIProvider apiProvider, PisstaubeDbContext dbContext, PisstaubeCacheDbContextFactory cacheFactory, SmartStorage smartStorage, RequestLimiter limiter, IBeatmapSearchEngineProvider search, IpfsCache ipfsCache ) { _storage = storage; _apiProvider = apiProvider; _dbContext = dbContext; _cacheFactory = cacheFactory; _smartStorage = smartStorage; _limiter = limiter; _search = search; _ipfsCache = ipfsCache; }
public void Configure(IAPIProvider apiProvider, PisstaubeCacheDbContextFactory cacheDbContextFactory, IBeatmapSearchEngineProvider searchEngine, PisstaubeDbContext dbContext) { Logger.Enabled = true; Logger.Level = LogLevel.Debug; Logger.GameIdentifier = "Pisstaube"; Logger.Storage = _dataStorage.GetStorageForDirectory("logs"); dbContext.Database.Migrate(); while (!searchEngine.IsConnected) { Logger.LogPrint("Search Engine is not yet Connected!", LoggingTarget.Database, LogLevel.Important); Thread.Sleep(1000); } cacheDbContextFactory.Get().Migrate(); _osuContextFactory.Get().Migrate(); JsonUtil.Initialize(); apiProvider.Login(Environment.GetEnvironmentVariable("OSU_USERNAME"), Environment.GetEnvironmentVariable("OSU_PASSWORD")); while (true) { if (!apiProvider.IsLoggedIn) { Logger.LogPrint("Not Logged in yet..."); Thread.Sleep(1000); continue; } if (apiProvider.State == APIState.Failing) { Logger.LogPrint($"Failed to Login using Username {Environment.GetEnvironmentVariable("OSU_USERNAME")}", LoggingTarget.Network, LogLevel.Error); Environment.Exit(1); } break; } }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAPIProvider apiProvider, PisstaubeCacheDbContextFactory cacheDbContextFactory, IBeatmapSearchEngineProvider searchEngine, PisstaubeDbContext dbContext) { Logger.Enabled = true; Logger.Level = LogLevel.Debug; Logger.GameIdentifier = "Pisstaube"; Logger.Storage = _dataStorage.GetStorageForDirectory("logs"); dbContext.Database.Migrate(); while (!searchEngine.IsConnected) { Logger.LogPrint("Search Engine is not yet Connected!", LoggingTarget.Database, LogLevel.Important); Thread.Sleep(1000); } cacheDbContextFactory.Get().Migrate(); _osuContextFactory.Get().Migrate(); DogStatsd.Configure(new StatsdConfig { Prefix = "pisstaube" }); JsonUtil.Initialize(); apiProvider.Login(Environment.GetEnvironmentVariable("OSU_USERNAME"), Environment.GetEnvironmentVariable("OSU_PASSWORD")); GlobalConfig.EnableCrawling = Environment.GetEnvironmentVariable("CRAWLER_DISABLED")?.ToLowerInvariant() == "false"; GlobalConfig.EnableUpdating = Environment.GetEnvironmentVariable("UPDATER_DISABLED")?.ToLowerInvariant() == "false"; while (true) { if (!apiProvider.IsLoggedIn) { Logger.LogPrint("Not Logged in yet..."); Thread.Sleep(1000); continue; } if (apiProvider.State == APIState.Failing) { Logger.LogPrint($"Failed to Login using Username {Environment.GetEnvironmentVariable("OSU_USERNAME")}", LoggingTarget.Network, LogLevel.Error); Environment.Exit(1); } break; } if (DebugUtils.IsDebugBuild) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseFileServer(new FileServerOptions { FileProvider = new PhysicalFileProvider(Path.Join(Directory.GetCurrentDirectory(), "data/wwwroot")), EnableDirectoryBrowsing = true, }); app.UseMvc(routes => routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}")); }
public SearchController(IBeatmapSearchEngineProvider searchEngine, IDistributedCache cache) { _searchEngine = searchEngine; _cache = cache; }