build log: timeout log request, truncate redis log
This commit is contained in:
parent
1d399390ad
commit
d483b5929e
|
@ -12,7 +12,7 @@ RosaABF.controller 'BuildLogController', ['$scope', '$http', '$timeout', ($scope
|
|||
return unless $scope.build_started
|
||||
|
||||
if $('.build-log').is(':visible')
|
||||
$http.get($scope.path).success((res) ->
|
||||
$http.get($scope.path, timeout: 30000).success((res) ->
|
||||
$scope.log = res.log
|
||||
$scope.build_started = res.building
|
||||
).error(->
|
||||
|
|
|
@ -39,7 +39,7 @@ class Platforms::ProductBuildListsController < Platforms::BaseController
|
|||
end
|
||||
|
||||
def log
|
||||
worker_log = @product_build_list.abf_worker_log
|
||||
worker_log = @product_build_list.abf_worker_log.truncate(40000)
|
||||
render json: {
|
||||
log: (Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log),
|
||||
building: @product_build_list.build_started?
|
||||
|
|
|
@ -171,7 +171,7 @@ class Projects::BuildListsController < Projects::BaseController
|
|||
|
||||
def log
|
||||
render json: {
|
||||
log: @build_list.log(params[:load_lines]),
|
||||
log: @build_list.log,
|
||||
building: @build_list.build_started?
|
||||
}
|
||||
end
|
||||
|
|
|
@ -519,9 +519,9 @@ class BuildList < ActiveRecord::Base
|
|||
build_published?
|
||||
end
|
||||
|
||||
def log(load_lines)
|
||||
def log(load_lines=nil)
|
||||
if new_core?
|
||||
worker_log = abf_worker_log
|
||||
worker_log = abf_worker_log.truncate(40000)
|
||||
Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log
|
||||
else
|
||||
I18n.t('layout.build_lists.log.not_available')
|
||||
|
|
Loading…
Reference in New Issue