예제 #1
0
 public Kaesereibe(PisstaubeDbContextFactory contextFactory, BeatmapSearchEngine searchEngine)
 {
     _pool           = new List <Thread>();
     _contextFactory = contextFactory;
     _searchEngine   = searchEngine;
     _workerThreads  = int.Parse(Environment.GetEnvironmentVariable("CRAWLER_THREADS"));
 }
예제 #2
0
 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;
 }
예제 #3
0
 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");
 }
예제 #4
0
 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;
 }
예제 #5
0
파일: Crawler.cs 프로젝트: Tiller431/yes
 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"));
 }
예제 #6
0
        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));
        }
예제 #7
0
파일: Startup.cs 프로젝트: Tiller431/yes
        // 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();
            }
        }
예제 #8
0
 public BeatmapController(PisstaubeDbContextFactory contextFactory) => _contextFactory = contextFactory;
예제 #9
0
 public HashController(PisstaubeDbContextFactory contextFactory) => _contextFactory = contextFactory;