small refactoring

This commit is contained in:
Alexander Machehin 2015-07-14 21:42:48 +05:00
parent d483b5929e
commit 2ff3c581b3
3 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Platforms::ProductBuildListsController < Platforms::BaseController
end
def log
worker_log = @product_build_list.abf_worker_log.truncate(40000)
worker_log = @product_build_list.abf_worker_log
render json: {
log: (Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log),
building: @product_build_list.build_started?

View File

@ -521,7 +521,7 @@ class BuildList < ActiveRecord::Base
def log(load_lines=nil)
if new_core?
worker_log = abf_worker_log.truncate(40000)
worker_log = abf_worker_log
Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log
else
I18n.t('layout.build_lists.log.not_available')

View File

@ -18,7 +18,7 @@ module AbfWorkerMethods
end
def abf_worker_log
self.class.log_server.get(service_queue) || I18n.t('layout.build_lists.log.not_available')
(self.class.log_server.get(service_queue) || I18n.t('layout.build_lists.log.not_available')).truncate(40000)
end
def add_job_to_abf_worker_queue