Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839require 'active_support/concern'
module S3Run extend ActiveSupport::Concern
included do def in_s3? file = $s3_bucket_internal.object("splits/#{s3_filename}") return file.exists? rescue Aws::S3::Errors::Forbidden return false end
def migrate_to_s3 if in_s3? puts "run in s3, skipping" return true end
if run_file.nil? puts "run_file is gone, skipping" return false end
object = $s3_bucket_internal.put_object( key: "splits/#{id36}", body: run_file.file )
if object.nil? || object.key.nil? raise "error uploading run to s3" end
puts "run stored in s3 :)" return true end endend