sufia-models/app/jobs/audit_job.rb in sufia-6.0.0.rc4 vs sufia-models/app/jobs/audit_job.rb in sufia-6.0.0

- old
+ new

@@ -1,23 +1,22 @@ -class AuditJob < ActiveFedoraPidBasedJob +class AuditJob < ActiveFedoraIdBasedJob def queue_name :audit end PASS = 'Passing Audit Run' FAIL = 'Failing Audit Run' - attr_accessor :uri, :pid, :path + attr_accessor :uri, :id, :path # URI of the resource to audit. # This URI could include the actual resource (e.g. content) and the version to audit: # http://localhost:8983/fedora/rest/test/a/b/c/abcxyz/content/fcr:versions/version1 # but it could also just be: # http://localhost:8983/fedora/rest/test/a/b/c/abcxyz/content def initialize(id, path, uri) - super(uri) - self.pid = id + super(id) self.path = path self.uri = uri end def run @@ -47,15 +46,15 @@ error_msg = "resource not found" end if fixity_ok passing = 1 - ChecksumAuditLog.prune_history(pid, path) + ChecksumAuditLog.prune_history(id, path) else logger.warn "***AUDIT*** Audit failed for #{uri} #{error_msg}" passing = 0 end - ChecksumAuditLog.create!(pass: passing, pid: pid, version: uri, dsid: path) + ChecksumAuditLog.create!(pass: passing, generic_file_id: id, version: uri, dsid: path) end def logger ActiveFedora::Base.logger end