Sha256: 903285acc6b073bd91771ffdc78aff1cfc005331b996e5b07e16f70b80da937d

Contents?: true

Size: 663 Bytes

Versions: 19

Compression:

Stored size: 663 Bytes

Contents

module Actions
  class DeliverLongRunningTasksNotification < EntryAction
    def plan(report)
      return if report.task_uuids.empty?

      plan_self report: report
    end

    def run
      report = OpenStruct.new(input[:report])
      tasks = ForemanTasks::Task.where(id: report.task_uuids)
      report.user = User.current
      report.tasks = tasks
      ::UINotifications::Tasks::TasksRunningLong.new(report).deliver!
      TasksMailer.long_tasks(report).deliver_now
    end

    def humanized_name
      _('Deliver notifications about long running tasks')
    end

    def rescue_strategy_for_self
      ::Dynflow::Action::Rescue::Skip
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
foreman-tasks-10.0.2 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-10.0.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-10.0.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.2.3 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.2.2 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.2.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.2.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.1.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.0.4 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.1.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.0.2 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.0.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.3.3 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-9.0.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.2.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.1.4 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.3.2 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.3.1 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.1.3 app/lib/actions/deliver_long_running_tasks_notification.rb