Sha256: 997c5ea148fd1b0b2528eda3a3baf039365c3c3849d09a16b0ce50687119afba
Contents?: true
Size: 711 Bytes
Versions: 8
Compression:
Stored size: 711 Bytes
Contents
module Pageflow class UploadFileToS3Job < ApplicationJob queue_as :slow include StateMachineJob def perform_with_result(file, _options = {}) if file && file.attachment_on_filesystem.file? if File.exist?(file.attachment_on_filesystem.path) file.attachment_on_s3 = file.attachment_on_filesystem file.save! file.attachment_on_filesystem.destroy :ok else logger.info "#{file.class.name} #{file.id} not yet transfered to instance." :pending end else logger.warn "#{file.class.name} #{file.id} does not have an attachment on the file system. ignoring." :error end end end end
Version data entries
8 entries across 8 versions & 1 rubygems