Class: Bosh::Director::Jobs::Helpers::BlobDeleter

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/jobs/helpers/blob_deleter.rb

Instance Method Summary collapse

Constructor Details

#initialize(blobstore, logger) ⇒ BlobDeleter

Returns a new instance of BlobDeleter.



5
6
7
8
# File 'lib/bosh/director/jobs/helpers/blob_deleter.rb', line 5

def initialize(blobstore, logger)
  @blobstore = blobstore
  @logger = logger
end

Instance Method Details

#delete(blobstore_id, errors, force) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bosh/director/jobs/helpers/blob_deleter.rb', line 10

def delete(blobstore_id, errors, force)
  begin
    @blobstore.delete(blobstore_id)
    return true
  rescue Exception => e
    @logger.warn("Could not delete blob with id '#{blobstore_id}' from blobstore: #{e}\n " + e.backtrace.join("\n"))
    errors << e
  end

  force
end