Class: CleanTrueWalletFileWorker

Inherits:
ApplicationWorker show all
Defined in:
app/workers/clean_true_wallet_file_worker.rb

Overview

typed: ignore

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(file_name, file_path) ⇒ Object



3
4
5
6
7
8
9
# File 'app/workers/clean_true_wallet_file_worker.rb', line 3

def perform(file_name, file_path)
  s3 = Aws::S3::Resource.new(region: Figaro.env.AWS_REGION!)
  target_obj = s3.bucket(Figaro.env.AWS_DOCS_BUCKET!).object(file_name)
  target_obj.delete

  File.delete(file_path) if File.exist?(file_path)
end