Class: Projects::DestroyRollbackService

Inherits:
BaseService show all
Includes:
Gitlab::ShellAdapter
Defined in:
app/services/projects/destroy_rollback_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from Gitlab::ShellAdapter

#gitlab_shell

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#executeObject


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/services/projects/destroy_rollback_service.rb', line 7

def execute
  return unless project

  Projects::ForksCountService.new(project).delete_cache

  unless rollback_repository(project.repository)
    raise_error(s_('DeleteProject|Failed to restore project repository. Please contact the administrator.'))
  end

  unless rollback_repository(project.wiki.repository)
    raise_error(s_('DeleteProject|Failed to restore wiki repository. Please contact the administrator.'))
  end
end