Skip to content

Commit

Permalink
Merge pull request #2137 from DFE-Digital/purge-later
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleese authored Apr 10, 2024
2 parents c1280cc + 001172b commit 3b79aeb
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 60 deletions.
8 changes: 0 additions & 8 deletions app/jobs/remove_malware_blob_job.rb

This file was deleted.

4 changes: 1 addition & 3 deletions app/services/fetch_malware_scan_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def call
upload.update!(
malware_scan_result: malware_scan_result_from_response(response),
)
if upload.scan_result_suspect?
RemoveMalwareBlobJob.perform_later(upload_id: upload.id)
end
upload.attachment.purge_later if upload.scan_result_suspect?
end
else
upload.update!(malware_scan_result: "error")
Expand Down
17 changes: 0 additions & 17 deletions app/services/remove_malware_blob.rb

This file was deleted.

4 changes: 1 addition & 3 deletions spec/services/fetch_malware_scan_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@
end

it "enqueues a job to remove the file" do
expect(RemoveMalwareBlobJob).to receive(:perform_later).with(
upload_id: upload.id,
)
expect(ActiveStorage::PurgeJob).to receive(:perform_later)
fetch_malware_scan_result
end
end
Expand Down
29 changes: 0 additions & 29 deletions spec/services/remove_malware_blob_spec.rb

This file was deleted.

0 comments on commit 3b79aeb

Please sign in to comment.