Class: Bosh::Director::Api::TaskRemover

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/api/task_remover.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_tasks) ⇒ TaskRemover

Returns a new instance of TaskRemover.



3
4
5
# File 'lib/bosh/director/api/task_remover.rb', line 3

def initialize(max_tasks)
  @max_tasks = max_tasks
end

Instance Method Details

#remove(type) ⇒ Object



7
8
9
10
11
12
# File 'lib/bosh/director/api/task_remover.rb', line 7

def remove (type)
  removal_candidates_dataset(type).each do |task|
    FileUtils.rm_rf(task.output) if task.output
    task.destroy
  end
end