protected virtual void ReadDatabaseEntries(IProgress <string> progress, CancellationToken cancellationToken) { progress?.Report($"Starting load of {ExpectedNumOfBeatmaps} beatmaps"); _mapDataStorer.StartMassStoring(); for (NumberOfLoadedBeatmaps = 0; NumberOfLoadedBeatmaps < ExpectedNumOfBeatmaps; NumberOfLoadedBeatmaps++) { if (NumberOfLoadedBeatmaps % 100 == 0) { progress?.Report($"Loading {NumberOfLoadedBeatmaps} of {ExpectedNumOfBeatmaps}"); } if (cancellationToken.IsCancellationRequested) { break; } ReadNextBeatmap(); } progress?.Report($"Loaded {NumberOfLoadedBeatmaps} beatmaps"); _mapDataStorer.EndMassStoring(); if (!cancellationToken.IsCancellationRequested) { LoadedSuccessfully = true; } }
protected virtual void ReadDatabaseEntries() { _logger?.Log("Starting MassStoring of {0} beatmaps", ExpectedNumOfBeatmaps.ToString()); _mapDataStorer.StartMassStoring(); for (NumberOfLoadedBeatmaps = 0; NumberOfLoadedBeatmaps < ExpectedNumOfBeatmaps; NumberOfLoadedBeatmaps++) { if (NumberOfLoadedBeatmaps % 100 == 0) _logger?.Log("Loading {0} of {1}", NumberOfLoadedBeatmaps.ToString(), ExpectedNumOfBeatmaps.ToString()); ReadNextBeatmap(); } _logger?.Log("Loaded {0} beatmaps", NumberOfLoadedBeatmaps.ToString()); _mapDataStorer.EndMassStoring(); LoadedSuccessfully = true; }
protected virtual void ReadDatabaseEntries() { _logger?.Log("Starting MassStoring of {0} beatmaps", ExpectedNumOfBeatmaps.ToString()); _mapDataStorer.StartMassStoring(); for (NumberOfLoadedBeatmaps = 0; NumberOfLoadedBeatmaps < ExpectedNumOfBeatmaps; NumberOfLoadedBeatmaps++) { if (NumberOfLoadedBeatmaps % 100 == 0) { _logger?.Log("Loading {0} of {1}", NumberOfLoadedBeatmaps.ToString(), ExpectedNumOfBeatmaps.ToString()); } //TODO: check if it is safe to remove all try/catch _stopProcessing stuff if (_stopProcessing) { throw _exception; } ReadNextBeatmap(); } _logger?.Log("Loaded {0} beatmaps", NumberOfLoadedBeatmaps.ToString()); _mapDataStorer.EndMassStoring(); }