[refs #893] some fixes from comments

This commit is contained in:
Alexander Machehin 2013-02-12 16:52:40 +06:00
parent a4d1d42792
commit 677195b116
4 changed files with 12 additions and 11 deletions

View File

@ -141,7 +141,7 @@ class Platforms::RepositoriesController < Platforms::BaseController
end
def regenerate_metadata
AbfWorker::BuildListsPublishTaskManager.repository_regenerate_metadata @repository
AbfWorker::BuildListsPublishTaskManager.repository_regenerate_metadata @repository.id
redirect_to platform_repository_path(@platform, @repository)
end

View File

@ -4,8 +4,9 @@
- else
.leftlist
.rightlist
= link_to t("layout.repositories.regenerate_metadata"), regenerate_metadata_platform_repository_path(@platform, @repository),
:method => :put, :confirm => t('layout.confirm'), :class => :button
-if can? :regenerate_metadata, @repository
= link_to t("layout.repositories.regenerate_metadata"), regenerate_metadata_platform_repository_path(@platform, @repository),
:method => :put, :confirm => t('layout.confirm'), :class => :button
.leftlist= f.label :description, t("activerecord.attributes.repository.description"), :class => :label
.rightlist= f.text_field :description, :class => 'text_field'

View File

@ -319,14 +319,15 @@ module AbfWorker
options = {
:id => Time.now.to_i,
#:arch => nil,
:arch => 'x86_64',
:distrib_type => distrib_type,
:cmd_params => cmd_params,
:platform => {:platform_path => platform_path},
:repository => {:id => rep.id},
:type => :regenerate,
:type => :publish,
:time_living => 9600, # 160 min
:lock_str => lock_str
:skip_feedback => true,
:extra => {:lock_str => lock_str, :regenerate => true}
}
Resque.push(

View File

@ -9,13 +9,12 @@ module AbfWorker
def perform
return if status == STARTED # do nothing when publication started
case options['type']
when 'resign'
if options['type'] == 'resign'
AbfWorker::BuildListsPublishTaskManager.unlock_repository options['id']
when 'regenerate'
AbfWorker::BuildListsPublishTaskManager.unlock_rep_and_platform nil, options['lock_str']
else
if options['extra']['create_container'] # Container has been created
if options['extra']['regenerate'] # Regenerate metadata
AbfWorker::BuildListsPublishTaskManager.unlock_rep_and_platform nil, options['lock_str']
elsif options['extra']['create_container'] # Container has been created
case status
when COMPLETED
subject.published_container