bulk_deletion.deletion_manager.currently_deleting_x_out_of_x=Currently deleting resources... ({0} out of {1})
bulk_deletion.deletion_manager.deletion_completed=Resource deletion completed.
bulk_deletion.deletion_manager.however_failures_occurred=However, some failures occurred.
+bulk_deletion.started_since_x=Started {0}
#------------------------------------------------------------------------------
# list of resources that could not be deleted because of a problem
@failed_deletions
+ # the time when the deletion was started
+ @start_time
+
def initialize
reinit()
end
@failed_deletions
end
+ def deletion_start_time
+ @start_time
+ end
+
def delete_resources(resource_ids=[])
# Use an exclusive block of code to ensure that only 1 thread will be able to proceed with the deletion
can_start_deletion = false
@message = Api::Utils.message('bulk_deletion.deletion_manager.no_resource_to_delete')
else
java_facade = Java::OrgSonarServerUi::JRubyFacade.getInstance()
+ @start_time = Time.now
# launch the deletion
resource_ids.each_with_index do |resource_id, index|
resource = Project.find(:first, :conditions => {:id => resource_id.to_i})
deletion_manager = ResourceDeletionManager.instance
pending_deletions = deletion_manager.currently_deleting_resources?
failed_deletions = deletion_manager.failed_deletions
+ start_time = deletion_manager.deletion_start_time
%>
<% if pending_deletions %>
<b><%= deletion_manager.message -%></b>
<br/>
<br/>
+ <%= message('bulk_deletion.started_since_x', :params => distance_of_time_in_words(start_time, Time.now) ) -%> (<%= l start_time -%>)
+ <br/>
+ <br/>
<% if !pending_deletions && !failed_deletions.empty? %>
<p>