You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: active_storage_patch.rb
    path of file: ./repos/bluedoc/config/initializers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Override
    
  def upload(key, io, checksum: nil, **)
    instrument :upload, key: key, checksum: checksum do
      object_for(key).put(upload_options.merge(body: io, content_md5: checksum, cache_control: "max-age=#{300.days}"))
    rescue Aws::S3::Errors::BadDigest
      raise ActiveStorage::IntegrityError
    end
  end