public Kaesereibe(PisstaubeDbContextFactory contextFactory, BeatmapSearchEngine searchEngine) { _pool = new List <Thread>(); _contextFactory = contextFactory; _searchEngine = searchEngine; _workerThreads = int.Parse(Environment.GetEnvironmentVariable("CRAWLER_THREADS")); }
public PrivateAPIController(PisstaubeDbContextFactory contextFactory, Storage storage, BeatmapSearchEngine searchEngine, Crawler crawler, Cleaner cleaner, PisstaubeCacheDbContextFactory cache, Kaesereibe reibe) { _contextFactory = contextFactory; _storage = storage; _searchEngine = searchEngine; _crawler = crawler; _cleaner = cleaner; _cache = cache; _reibe = reibe; }
public IndexController(APIAccess apiAccess, Storage storage, PisstaubeCacheDbContextFactory cache, BeatmapDownloader downloader, SetDownloader setDownloader, PisstaubeDbContextFactory contextFactory) { _apiAccess = apiAccess; _storage = storage; _cache = cache; _downloader = downloader; _setDownloader = setDownloader; _contextFactory = contextFactory; _fileStorage = storage.GetStorageForDirectory("files"); }
public SetDownloader(Storage storage, APIAccess apiAccess, PisstaubeDbContextFactory factory, PisstaubeCacheDbContextFactory cfactory, Cleaner cleaner, RequestLimiter limiter, BeatmapSearchEngine search ) { _storage = storage; _apiAccess = apiAccess; _factory = factory; _cfactory = cfactory; _cleaner = cleaner; _limiter = limiter; _search = search; }
public Crawler(BeatmapSearchEngine search, APIAccess apiAccess, RulesetStore store, BeatmapDownloader downloader, PisstaubeCacheDbContextFactory cache, RequestLimiter rl, PisstaubeDbContextFactory contextFactory) { _pool = new List <Thread>(); _search = search; _apiAccess = apiAccess; _store = store; _downloader = downloader; _cache = cache; _rl = rl; _contextFactory = contextFactory; _workerThreads = int.Parse(Environment.GetEnvironmentVariable("CRAWLER_THREADS")); }
public BMUpdater(PisstaubeDbContextFactory factory, APIAccess apiAccess, BeatmapDownloader bmDl, PisstaubeCacheDbContextFactory cFactory, RulesetStore store, Storage storage, BeatmapSearchEngine search, int limit = 100 /* 100 beatmaps can be updated at the same time per minute! */) { _factory = factory; _apiAccess = apiAccess; _bmDl = bmDl; _cFactory = cFactory; _store = store; _storage = storage; _search = search; _rl = new RequestLimiter(limit, TimeSpan.FromMinutes(1)); }
// ReSharper disable once UnusedParameter.Local public Startup(IConfiguration configuration) { dataStorage = new NativeStorage("data"); osuContextFactory = new DatabaseContextFactory(dataStorage); cacheContextFactory = new PisstaubeCacheDbContextFactory(dataStorage); dbContextFactory = new PisstaubeDbContextFactory(); // copy paste of OsuGameBase.cs try { using (var db = dbContextFactory.GetForWrite(false)) db.Context.Database.Migrate(); using (var db = osuContextFactory.GetForWrite(false)) db.Context.Migrate(); } catch (Exception e) { Logger.Error(e.InnerException ?? e, "Migration failed! We'll be starting with a fresh database.", LoggingTarget.Database); osuContextFactory.ResetDatabase(); Logger.Log("Database purged successfully.", LoggingTarget.Database); using (var db = osuContextFactory.GetForWrite(false)) db.Context.Migrate(); } // copy paste of OsuGameBase.cs try { using (var db = cacheContextFactory.GetForWrite(false)) db.Context.Migrate(); } catch (Exception e) { Logger.Error(e.InnerException ?? e, "Migration failed! We'll be starting with a fresh database.", LoggingTarget.Database); cacheContextFactory.ResetDatabase(); Logger.Log("Database purged successfully.", LoggingTarget.Database); using (var db = cacheContextFactory.GetForWrite(false)) db.Context.Migrate(); } }
public BeatmapController(PisstaubeDbContextFactory contextFactory) => _contextFactory = contextFactory;
public HashController(PisstaubeDbContextFactory contextFactory) => _contextFactory = contextFactory;