mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
22 lines
461 B
Ruby
22 lines
461 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
module Points
|
||
|
|
module RawData
|
||
|
|
class ArchiveJob < ApplicationJob
|
||
|
|
queue_as :archival
|
||
|
|
|
||
|
|
def perform
|
||
|
|
return unless ENV['ARCHIVE_RAW_DATA'] == 'true'
|
||
|
|
|
||
|
|
stats = Points::RawData::Archiver.new.call
|
||
|
|
|
||
|
|
Rails.logger.info("Archive job complete: #{stats}")
|
||
|
|
rescue StandardError => e
|
||
|
|
ExceptionReporter.call(e, 'Points raw data archival job failed')
|
||
|
|
|
||
|
|
raise
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|