Class: Projects::ContainerRepository::Gitlab::CleanupTagsService
- Inherits:
-
CleanupTagsBaseService
- Object
- BaseContainerService
- BaseContainerRepositoryService
- CleanupTagsBaseService
- Projects::ContainerRepository::Gitlab::CleanupTagsService
- Includes:
- Timeoutable
- Defined in:
- app/services/projects/container_repository/gitlab/cleanup_tags_service.rb
Constant Summary collapse
- TAGS_PAGE_SIZE =
1000
Constants included from Timeoutable
Timeoutable::DISABLED_TIMEOUTS, Timeoutable::TimeoutError
Instance Attribute Summary
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(container_repository:, current_user: nil, params: {}) ⇒ CleanupTagsService
constructor
A new instance of CleanupTagsService.
Methods inherited from BaseContainerService
#group_container?, #namespace_container?, #project_container?, #project_group
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
Constructor Details
#initialize(container_repository:, current_user: nil, params: {}) ⇒ CleanupTagsService
Returns a new instance of CleanupTagsService.
11 12 13 14 |
# File 'app/services/projects/container_repository/gitlab/cleanup_tags_service.rb', line 11 def initialize(container_repository:, current_user: nil, params: {}) super @params = params.dup end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/services/projects/container_repository/gitlab/cleanup_tags_service.rb', line 16 def execute with_timeout do |start_time, result| container_repository.(page_size: TAGS_PAGE_SIZE) do || (, result) raise TimeoutError if !timeout_disabled? && timeout?(start_time) end end end |