#755: remove old logs from PublishObserver

This commit is contained in:
Vokhmin Alexey V 2012-12-12 16:32:47 +04:00
parent 281346a546
commit 5003101211
2 changed files with 13 additions and 1 deletions

View File

@ -7,7 +7,11 @@ module AbfWorker
BUILD_CANCELED = 4
def self.update_results(subject, options)
results = (subject.results || [])+ options['results']
results = (subject.results || []) + options['results']
sort_results_and_save(subject, results)
end
def self.sort_results_and_save(subject, results)
subject.results = results.sort_by{ |r| r['file_name'] }
subject.save!
end

View File

@ -18,5 +18,13 @@ module AbfWorker
end
end
def self.update_results(subject, options)
results = (subject.results || []).
map{ |r| r if r['file_name'] !~ /^abfworker\:\:publish\-build\-list\-container\-worker.*\.log$/ }.
compact
results += options['results']
sort_results_and_save(subject, results)
end
end
end