Sha256: e897979250b3bdfdcbba9119642ab456dc3d148f01388087c41038d284eddb22

Contents?: true

Size: 583 Bytes

Versions: 4

Compression:

Stored size: 583 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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman-tasks-8.3.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.2.0 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.1.2 app/lib/actions/deliver_long_running_tasks_notification.rb
foreman-tasks-8.1.1 app/lib/actions/deliver_long_running_tasks_notification.rb