diff options
Diffstat (limited to 'lib/gitlab/import_export/statistics_restorer.rb')
-rw-r--r-- | lib/gitlab/import_export/statistics_restorer.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/import_export/statistics_restorer.rb b/lib/gitlab/import_export/statistics_restorer.rb new file mode 100644 index 00000000000..bcdd9c12c85 --- /dev/null +++ b/lib/gitlab/import_export/statistics_restorer.rb @@ -0,0 +1,17 @@ +module Gitlab + module ImportExport + class StatisticsRestorer + def initialize(project:, shared:) + @project = project + @shared = shared + end + + def restore + @project.statistics.refresh! + rescue => e + @shared.error(e) + false + end + end + end +end |