Skip to content

Embargo Release Processing

Naomi Dushay edited this page Jun 14, 2016 · 7 revisions

cron job checks calls embargo_release.rb script in common_accessioning

VM: sul-robots(n)-(prod|test) script: https://github.com/sul-dlss/common-accessioning/blob/master/robots/accession/embargo_release.rb

cron job: 16 2 * * * /bin/bash -l -c 'BUNDLE_GEMFILE=/home/lyberadmin/common-accessioning/current/Gemfile ROBOT_ENVIRONMENT=test /usr/local/rvm/wrappers/default/ruby /home/lyberadmin/common-accessioning/current/robots/accession/embargo_release.rb >> /home/lyberadmin/common-accessioning/current/log/crondebug.log 2>&1'

embargo_release.rb script:

  • Solr query
    • "embargo_status_ssim:\"embargoed\" AND embargo_release_dtsim:[* TO NOW]"
    • "twenty_pct_status_ssim:\"embargoed\" AND twenty_pct_visibility_release_dtsim:[* TO NOW]"
  • for each result
    • load as Dor::Item (item=Dor::Item.find("druid:#{druid}"))
    • calls item.open_new_version
    • calls item.release_embargo('application:accessionWF:embargo-release')
    • calls item.close_version
    • calls item.save

Dor::Item.release_embargo

Dor::Item.close_version

Clone this wiki locally