예제 #1
0
 private static void MetricUpdater(IAPIProvider provider, SmartStorage smartStorage, ICrawler osuCrawler, DatabaseHouseKeeper houseKeeper)
 {
     while (true)
     {
         DogStatsd.ServiceCheck("is_active", Status.OK);
         DogStatsd.ServiceCheck("is_crawling", GlobalConfig.EnableCrawling ? Status.OK : Status.WARNING);
         DogStatsd.ServiceCheck("is_search_enabled", GlobalConfig.EnableSearch ? Status.OK : Status.CRITICAL);
         DogStatsd.ServiceCheck("is_updating_enabled", GlobalConfig.EnableUpdating ? Status.OK : Status.CRITICAL);
         DogStatsd.ServiceCheck("osu_api_status", provider?.State switch
         {
             APIState.Offline => Status.CRITICAL,
             APIState.Failing => Status.CRITICAL,
             APIState.Connecting => Status.WARNING,
             APIState.Online => Status.OK,
             _ => Status.UNKNOWN
         });
예제 #2
0
 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;
 }