lib/dor/workflow_archiver.rb
def archive_rows(objs)
      objs.each do |obj|
        tries = 0
        begin
          tries += 1
          do_one_archive(obj)
          @archived += 1
        rescue => e
          LyberCore::Log.error "Rolling back transaction due to: #{e.inspect}\n" << e.backtrace.join("\n") << "\n!!!!!!!!!!!!!!!!!!"
          if tries < 3 # Retry this druid up to 3 times
            LyberCore::Log.error "  Retrying archive operation in #{@retry_delay} seconds..."
            sleep @retry_delay
            retry
          end
          LyberCore::Log.error "  Too many retries.  Giving up on #{obj.inspect}"

          @errors += 1
          if @errors >= 3
            LyberCore::Log.fatal('Too many errors. Archiving halted')
            break
          end
        end
      end # druids.each
    end
# Copies rows from the workflow table to the workflow_archive table, then deletes the rows from workflow
# Both operations must complete, or they get rolled back
# @param [Array<ArchiveCriteria>] objs List of objects returned from {#find_completed_objects} and mapped to an array of ArchiveCriteria objects.
Copies rows from the workflow table to the workflow_archive table, then deletes the rows from workflow
Both operations must complete, or they get rolled back
Copies rows from the workflow table to the workflow_archive table then deletes the rows from workflow Both operations must complete or they get rolled back
def archive_rows(objs)
      objs.each do |obj|
        tries = 0
        begin
          tries += 1
          do_one_archive(obj)
          @archived += 1
        rescue => e
          LyberCore::Log.error "Rolling back transaction due to: #{e.inspect}\n" << e.backtrace.join("\n") << "\n!!!!!!!!!!!!!!!!!!"
          if tries < 3 
            LyberCore::Log.error "  Retrying archive operation in #{@retry_delay} seconds..."
            sleep @retry_delay
            retry
          end
          LyberCore::Log.error "  Too many retries.  Giving up on #{obj.inspect}"
          @errors += 1
          if @errors >= 3
            LyberCore::Log.fatal('Too many errors. Archiving halted')
            break
          end
        end
      end 
    end
def archive_rows ( objs ) objs . each do | obj | tries = 0 begin tries += 1 do_one_archive ( obj ) @archived += 1 rescue => e LyberCore :: Log . error "Rolling back transaction due to: #{e.inspect}\n" << e . backtrace . join ( "\n" ) << "\n!!!!!!!!!!!!!!!!!!" if tries < 3 LyberCore :: Log . error "  Retrying archive operation in #{@retry_delay} seconds..." sleep @retry_delay retry end LyberCore :: Log . error "  Too many retries.  Giving up on #{obj.inspect}" @errors += 1 if @errors >= 3 LyberCore :: Log . fatal ( 'Too many errors. Archiving halted' ) break end end end end
Copies rows from the workflow table to the workflow_archive table, then deletes the rows from workflow
Both operations must complete, or they get rolled back
Copies rows from the workflow table to the workflow_archive table then deletes the rows from workflow Both operations must complete or they get rolled back
# Retry this druid up to 3 times # druids.each
objs
objs List of objects returned from {#find_completed_objects} and mapped to an array of ArchiveCriteria objects.
objs List of objects returned from { #find_completed_objects } and mapped to an array of ArchiveCriteria objects .