Skip to content

Commit

Permalink
Merge pull request #924 from parthaa/clear-ouput
Browse files Browse the repository at this point in the history
Clear shell process log before restart
  • Loading branch information
parthaa authored Nov 18, 2024
2 parents 48f9d74 + 9ad4d7c commit 2506bd7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/foreman_inventory_upload/async/shell_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ShellProcess < ::Actions::EntryAction
include ::ForemanRhCloud::Async::ExponentialBackoff

def plan(instance_label, more_inputs = {})
clear_task_output(instance_label)
inputs = more_inputs.merge(instance_label: instance_label)
plan_self(inputs)
end
Expand Down Expand Up @@ -53,6 +54,11 @@ def rescue_strategy_for_self
Dynflow::Action::Rescue::Fail
end

def clear_task_output(label)
TaskOutputLine.where(label: label).delete_all
TaskOutputStatus.where(label: label).delete_all
end

private

def preprocess_command(command)
Expand Down

0 comments on commit 2506bd7

Please sign in to comment.