Class: AuditJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/audit_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(file_set, file_id, uri) ⇒ Object

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

Parameters:

  • file_set (FileSet)
    • the parent object

  • file_id (String)
    • used to find the file within its parent object (usually “original_file”)

  • uri (String)
    • of the specific file/version to be audited



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/jobs/audit_job.rb', line 10

def perform(file_set, file_id, uri)
  log = run_audit(file_set, file_id, uri)
  fixity_ok = log.pass == 1
  unless fixity_ok
    if Hyrax.config.callback.set?(:after_audit_failure)
       = file_set.depositor
      user = User.find_by_user_key()
      Hyrax.config.callback.run(:after_audit_failure, file_set, user, log.created_at)
    end
  end
  fixity_ok
end