Sha256: 3e2e87947688ccc7135db4a81722708aa5b735b05490453d0f04935718ce6b50
Contents?: true
Size: 924 Bytes
Versions: 27
Compression:
Stored size: 924 Bytes
Contents
module Ddr module Events class VirusCheckEvent < Event include PreservationEventBehavior include ReindexObjectAfterSave self.preservation_event_type = :vir self.description = "Content file scanned for viruses" def to_solr { Ddr::IndexFields::LAST_VIRUS_CHECK_ON => event_date_time_s, Ddr::IndexFields::LAST_VIRUS_CHECK_OUTCOME => outcome } end # Message sent by ActiveSupport::Notifications def self.call(*args) notification = ActiveSupport::Notifications::Event.new(*args) result = notification.payload[:result] # Ddr::Antivirus::ScanResult instance create(pid: notification.payload[:pid], event_date_time: result.scanned_at, outcome: result.ok? ? SUCCESS : FAILURE, software: result.version, detail: result.to_s ) end end end end
Version data entries
27 entries across 27 versions & 1 rubygems