class SauceWhisk::Assets
def self.delete(job_id)
def self.delete(job_id) retries ||= SauceWhisk.asset_fetch_retries attempts ||= 1 data = rest_delete "#{job_id}/assets/" Asset.new({:data => data,:job_id => job_id}) rescue RestClient::ResourceNotFound => e if attempts <= retries attempts += 1 sleep(5) retry else raise e end # Return nil as all of the assets we're already deleted. rescue RestClient::BadRequest => e nil end