diff --git a/app/models/build_list.rb b/app/models/build_list.rb index accdb73f9..d2acc0ae9 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -201,7 +201,7 @@ class BuildList < ActiveRecord::Base end event :build_error do - transition [:build_started, :build_canceled] => :build_error + transition [:build_started, :build_canceled, :build_canceling] => :build_error end HUMAN_STATUSES.each do |code,name| diff --git a/app/models/build_list/item.rb b/app/models/build_list/item.rb index 36d7fab6c..540fa5a80 100644 --- a/app/models/build_list/item.rb +++ b/app/models/build_list/item.rb @@ -7,14 +7,15 @@ class BuildList::Item < ActiveRecord::Base GIT_ERROR = 5 - STATUSES = [BuildServer::SUCCESS, BuildServer::DEPENDENCIES_ERROR, BuildServer::BUILD_ERROR, BuildServer::BUILD_STARTED, GIT_ERROR] + STATUSES = [BuildServer::SUCCESS, BuildServer::DEPENDENCIES_ERROR, BuildServer::BUILD_ERROR, BuildServer::BUILD_STARTED, GIT_ERROR, BuildList::BUILD_CANCELED] HUMAN_STATUSES = { nil => :unknown, GIT_ERROR => :git_error, BuildServer::DEPENDENCIES_ERROR => :dependencies_error, BuildServer::SUCCESS => :success, BuildServer::BUILD_STARTED => :build_started, - BuildServer::BUILD_ERROR => :build_error + BuildServer::BUILD_ERROR => :build_error, + BuildList::BUILD_CANCELED => :build_canceled } scope :recent, order("level ASC, name ASC") diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index de90011ee..7b8be15ba 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -101,6 +101,7 @@ en: success: Build complete unknown: Build is waiting git_error: Git error + build_canceled: Build canceled statuses: build_lists: All diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index c7fb18275..d4d5a5b32 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -98,6 +98,7 @@ ru: success: собран unknown: ожидает сборки git_error: проблема с гит + build_canceled: сборка отменена statuses: build_lists: Всего diff --git a/lib/abf_worker/model_helper.rb b/lib/abf_worker/model_helper.rb index b9f6fc323..0803ead49 100644 --- a/lib/abf_worker/model_helper.rb +++ b/lib/abf_worker/model_helper.rb @@ -7,7 +7,7 @@ module AbfWorker def abf_worker_log q = 'abfworker::' - q << worker_queue + q << worker_queue('-') q << '-' q << id.to_s Resque.redis.get(q) || I18n.t('layout.build_lists.log.not_available') @@ -49,15 +49,18 @@ module AbfWorker def live_inspector_queue q = 'abfworker::' - q << worker_queue + q << worker_queue('-') q << '-' q << id.to_s q << '::live-inspector' q end - def worker_queue - is_a?(BuildList) ? 'rpm_worker' : 'iso_worker' + def worker_queue(delimiter = '_') + a = [] + a << (is_a?(BuildList) ? 'rpm' : 'iso') + a << 'worker' + a.join(delimiter) end def worker_queue_class diff --git a/lib/abf_worker/rpm_worker_observer.rb b/lib/abf_worker/rpm_worker_observer.rb index 10b4c1c7a..618114462 100644 --- a/lib/abf_worker/rpm_worker_observer.rb +++ b/lib/abf_worker/rpm_worker_observer.rb @@ -25,6 +25,7 @@ module AbfWorker bl.start_build when BUILD_CANCELED bl.update_attributes({:status => BuildList::BUILD_CANCELED}) + item.update_attributes({:status => BuildList::BUILD_CANCELED}) end if status != BUILD_STARTED fill_container_data bl, options