Sha256: 9f4c11c4b4be798b8b0e04f737da3a1cff1efbc5e4b1ee5e178c91a8f033de69
Contents?: true
Size: 855 Bytes
Versions: 33
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true module Cron # # Clean up Audit Logs that have not been updated in 90 days # class TrimDelayedJobWorkers < TrimCollection # # Fetch each Audit Log and delete it if hasn't been updated in 90 days # def collection Delayed::Jobs::Worker.all end # # Check if the cron job server hasn't reported in a while # def archive?(worker) super && worker.runs.blank? rescue StandardError => error App47Logger.log_warn "Unable to archive item #{worker.inspect}", error false end # # Return which field to use for comparison when trimming objects # def comparison_field :last_check_in_at end # # Allowed time the amount of time allowed to exists before deleting # def allowed_time 2.days.ago.utc end end end
Version data entries
33 entries across 33 versions & 1 rubygems