Class: Katello::Events::AutoPublishCompositeView
- Inherits:
-
Object
- Object
- Katello::Events::AutoPublishCompositeView
- Defined in:
- app/models/katello/events/auto_publish_composite_view.rb
Constant Summary collapse
- EVENT_TYPE =
'auto_publish_composite_view'.freeze
Instance Attribute Summary collapse
-
#composite_view ⇒ Object
readonly
Returns the value of attribute composite_view.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#retry ⇒ Object
Returns the value of attribute retry.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(composite_view_id) {|_self| ... } ⇒ AutoPublishCompositeView
constructor
A new instance of AutoPublishCompositeView.
- #run ⇒ Object
Constructor Details
#initialize(composite_view_id) {|_self| ... } ⇒ AutoPublishCompositeView
Returns a new instance of AutoPublishCompositeView.
13 14 15 16 17 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 13 def initialize(composite_view_id) @composite_view = ::Katello::ContentView.find_by_id(composite_view_id) Rails.logger.warn "Content View not found for ID #{object_id}" if @composite_view.nil? yield(self) if block_given? end |
Instance Attribute Details
#composite_view ⇒ Object (readonly)
Returns the value of attribute composite_view.
6 7 8 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 6 def composite_view @composite_view end |
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 7 def end |
#retry ⇒ Object
Returns the value of attribute retry.
7 8 9 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 7 def retry @retry end |
Class Method Details
.retry_seconds ⇒ Object
9 10 11 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 9 def self.retry_seconds 180 end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/models/katello/events/auto_publish_composite_view.rb', line 19 def run return unless composite_view begin ForemanTasks.async_task(::Actions::Katello::ContentView::Publish, composite_view, [:description], triggered_by: [:version_id]) rescue => e self.retry = true if e.is_a?(ForemanTasks::Lock::LockConflict) deliver_failure_notification raise e end end |