lib/couch.rb
# Flushes the given hashes to CouchDB
Flushes the given hashes to CouchDB
Flushes the given hashes to CouchDB
def post_bulk_throttled(db, docs, &block)
        bulk = []
        docs.each do |doc|
          bulk << doc
          if bulk.to_json.bytesize/1024/1024 > options[:flush_size_mb] or bulk.length >= options[:max_array_length]
            handle_bulk_flush(bulk, db, block)
          end
        end
        if bulk.length > 0
          handle_bulk_flush(bulk, db, block)
        end
      end
def post_bulk_throttled ( db , docs , & block ) bulk = [ ] docs . each do | doc | bulk << doc if bulk . to_json . bytesize / 1024 / 1024 > options [ :flush_size_mb ] or bulk . length >= options [ :max_array_length ] handle_bulk_flush ( bulk , db , block ) end end if bulk . length > 0 handle_bulk_flush ( bulk , db , block ) end end
Flushes the given hashes to CouchDB
Flushes the given hashes to CouchDB
# puts "Flushing #{docs.length} docs"
db
<not_specific>
docs
<not_specific>
block
<not_specific>