Class: Gitlab::ImportExport::StatisticsRestorer
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::StatisticsRestorer
- Includes:
- Import::Framework::ProgressTracking
- Defined in:
- lib/gitlab/import_export/statistics_restorer.rb
Constant Summary
Constants included from Import::Framework::ProgressTracking
Import::Framework::ProgressTracking::CACHE_EXPIRATION
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
-
#initialize(project:, shared:) ⇒ StatisticsRestorer
constructor
A new instance of StatisticsRestorer.
- #restore ⇒ Object
Methods included from Import::Framework::ProgressTracking
#processed_entry?, #save_processed_entry, #with_progress_tracking
Constructor Details
#initialize(project:, shared:) ⇒ StatisticsRestorer
Returns a new instance of StatisticsRestorer.
10 11 12 13 |
# File 'lib/gitlab/import_export/statistics_restorer.rb', line 10 def initialize(project:, shared:) @project = project @shared = shared end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
8 9 10 |
# File 'lib/gitlab/import_export/statistics_restorer.rb', line 8 def project @project end |
Instance Method Details
#restore ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/import_export/statistics_restorer.rb', line 15 def restore with_progress_tracking(**) do @project.statistics.refresh! end rescue StandardError => e @shared.error(e) false end |