Skip to content

Commit

Permalink
Merge pull request #95 from Opetushallitus/OY-4820_estetaan_tyhja_buc…
Browse files Browse the repository at this point in the history
…ketav_pyynto

OY-4820 Ei lähetetä BucketAV:lle skannauspyyntöä tyhjälle joukolle tiedostoja
  • Loading branch information
jkorri authored May 7, 2024
2 parents 242b0f7 + f44e69b commit cd3ed40
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/liiteri/virus_scan.clj
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,18 @@
Scanner

(request-file-scan [this metadata]
(doseq [file metadata]
(log/info (str "Requesting file scan for " (:key file) ", to bucket " (:s3-bucket this))))
(.sendMessage (:sqs-request-scan-client this) (:request-queue-url this)
(json/generate-string {:objects
(map (fn [file]
{:bucket (:s3-bucket this)
:key (:key file)
:custom_data (json/generate-string {:start-time (System/currentTimeMillis)
:filename (:filename file)
:content-type (:content-type file)})})
metadata)}))))
(when (not-empty metadata)
(doseq [file metadata]
(log/info (str "Requesting file scan for " (:key file) ", to bucket " (:s3-bucket this))))
(.sendMessage (:sqs-request-scan-client this) (:request-queue-url this)
(json/generate-string {:objects
(map (fn [file]
{:bucket (:s3-bucket this)
:key (:key file)
:custom_data (json/generate-string {:start-time (System/currentTimeMillis)
:filename (:filename file)
:content-type (:content-type file)})})
metadata)})))))

(defn new-scanner []
(map->VirusScanner {}))

0 comments on commit cd3ed40

Please sign in to comment.