Class: Actions::Insights::EmailPoller
Defined Under Namespace
Classes: RunOnceCoordinatorLock
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#can_mask_rules, #can_unregister_system, #current_organization_object, #disconnected_org?, #get_basic_auth_options, #get_branch_id_for_org, #get_branch_id_for_uuid, #get_content_host, #get_content_hosts, #get_default_ssl_ca_file, #get_http_options, #get_http_user_agent, #get_leaf_id, #get_mutual_tls_auth_options, #get_organization, #get_plugin_parent_name, #get_plugin_parent_version, #get_portal_http_proxy, #get_rha_plugin_name, #get_rha_plugin_rpm_name, #get_rha_plugin_version, #get_ssl_options_for_org, #get_ssl_options_for_uuid, #get_tapi_timeout, #get_telemetry_config, #get_upload_timeout, #insights_api_host, #is_org_selected?, #is_susbcribed_to_redhat?, #telemetry_enabled?, #telemetry_enabled_for_uuid?, #upstream_owner, #use_basic_auth?, #use_subsets?, #user_login_to_hash
Class Attribute Details
.triggered_action ⇒ Object
Returns the value of attribute triggered_action.
14
15
16
|
# File 'app/lib/actions/insights/email_poller.rb', line 14
def triggered_action
@triggered_action
end
|
Class Method Details
.ensure_running(world = ForemanTasks.dynflow.world) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/lib/actions/insights/email_poller.rb', line 15
def ensure_running(world = ForemanTasks.dynflow.world)
world.coordinator.acquire(RunOnceCoordinatorLock.new(world)) do
unless ForemanTasks::Task::DynflowTask.for_action(self).any?
params = {:mode => :recurring,
:input_type => :cronline,
:cronline => "0 0 * * 6"}
triggering = ForemanTasks::Triggering.new_from_params(params)
triggering.save!
triggering.reload
@triggered_action = triggering.trigger(self)
end
end
rescue Dynflow::Coordinator::LockError
return false
end
|
Instance Method Details
#humanized_name ⇒ Object
32
33
34
|
# File 'app/lib/actions/insights/email_poller.rb', line 32
def humanized_name
N_('Insights Email Notifications')
end
|
#plan ⇒ Object
36
37
38
39
40
|
# File 'app/lib/actions/insights/email_poller.rb', line 36
def plan
Rails.logger.debug("Planning Task ")
plan_self
end
|
#rescue_strategy_for_self ⇒ Object
60
61
62
|
# File 'app/lib/actions/insights/email_poller.rb', line 60
def rescue_strategy_for_self
Dynflow::Action::Rescue::Skip
end
|
#run ⇒ Object
42
43
44
45
46
47
48
49
|
# File 'app/lib/actions/insights/email_poller.rb', line 42
def run
Rails.logger.debug("Running Task")
Organization.all.each do |org|
if telemetry_enabled?(org) && is_susbcribed_to_redhat?(org)
weekly_summary(org)
end
end
end
|
#weekly_summary(org) ⇒ Object