[refs #893] some fixes from comments
This commit is contained in:
parent
a4d1d42792
commit
677195b116
|
@ -141,7 +141,7 @@ class Platforms::RepositoriesController < Platforms::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def regenerate_metadata
|
def regenerate_metadata
|
||||||
AbfWorker::BuildListsPublishTaskManager.repository_regenerate_metadata @repository
|
AbfWorker::BuildListsPublishTaskManager.repository_regenerate_metadata @repository.id
|
||||||
redirect_to platform_repository_path(@platform, @repository)
|
redirect_to platform_repository_path(@platform, @repository)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,9 @@
|
||||||
- else
|
- else
|
||||||
.leftlist
|
.leftlist
|
||||||
.rightlist
|
.rightlist
|
||||||
= link_to t("layout.repositories.regenerate_metadata"), regenerate_metadata_platform_repository_path(@platform, @repository),
|
-if can? :regenerate_metadata, @repository
|
||||||
:method => :put, :confirm => t('layout.confirm'), :class => :button
|
= 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
|
.leftlist= f.label :description, t("activerecord.attributes.repository.description"), :class => :label
|
||||||
.rightlist= f.text_field :description, :class => 'text_field'
|
.rightlist= f.text_field :description, :class => 'text_field'
|
||||||
|
|
|
@ -319,14 +319,15 @@ module AbfWorker
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
:id => Time.now.to_i,
|
:id => Time.now.to_i,
|
||||||
#:arch => nil,
|
:arch => 'x86_64',
|
||||||
:distrib_type => distrib_type,
|
:distrib_type => distrib_type,
|
||||||
:cmd_params => cmd_params,
|
:cmd_params => cmd_params,
|
||||||
:platform => {:platform_path => platform_path},
|
:platform => {:platform_path => platform_path},
|
||||||
:repository => {:id => rep.id},
|
:repository => {:id => rep.id},
|
||||||
:type => :regenerate,
|
:type => :publish,
|
||||||
:time_living => 9600, # 160 min
|
:time_living => 9600, # 160 min
|
||||||
:lock_str => lock_str
|
:skip_feedback => true,
|
||||||
|
:extra => {:lock_str => lock_str, :regenerate => true}
|
||||||
}
|
}
|
||||||
|
|
||||||
Resque.push(
|
Resque.push(
|
||||||
|
|
|
@ -9,13 +9,12 @@ module AbfWorker
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
return if status == STARTED # do nothing when publication started
|
return if status == STARTED # do nothing when publication started
|
||||||
case options['type']
|
if options['type'] == 'resign'
|
||||||
when 'resign'
|
|
||||||
AbfWorker::BuildListsPublishTaskManager.unlock_repository options['id']
|
AbfWorker::BuildListsPublishTaskManager.unlock_repository options['id']
|
||||||
when 'regenerate'
|
|
||||||
AbfWorker::BuildListsPublishTaskManager.unlock_rep_and_platform nil, options['lock_str']
|
|
||||||
else
|
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
|
case status
|
||||||
when COMPLETED
|
when COMPLETED
|
||||||
subject.published_container
|
subject.published_container
|
||||||
|
|
Loading…
Reference in New Issue