Fix for reindex console output too large

This commit is contained in:
Adam
2016-02-02 17:06:22 +01:00
parent 1b9f38a9c0
commit 97f6b34518
2 changed files with 3 additions and 3 deletions

View File

@@ -74,10 +74,10 @@ class ItemsController < ApplicationController
when 'import_items'
@output = ItemsHelper::execute_command("rake ribica:import_items -f #{Rails.root}/Rakefile")
@output.collect{|x| x.sub! "\n", "" }
ItemsHelper::execute_command("rake ribica:reindex -f #{Rails.root}/Rakefile") unless RakeTasksHelper::is_error_occurred @output
%x(rake ribica:reindex -f #{Rails.root}/Rakefile) unless RakeTasksHelper::is_error_occurred @output
when 'update_prices'
@output = ItemsHelper::execute_command("rake ribica:update_prices -f #{Rails.root}/Rakefile")
ItemsHelper::execute_command("rake ribica:reindex -f #{Rails.root}/Rakefile") unless RakeTasksHelper::is_error_occurred @output
%x(rake ribica:reindex -f #{Rails.root}/Rakefile) unless RakeTasksHelper::is_error_occurred @output
else
@error_message = "There is no such task"
end