public
Created

testgridfs

  • Download Gist
testgridfs.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#! /usr/bin/env python
 
import pymongo
import gridfs
 
import os
 
count = 0
 
def _testgridfs():
conn = pymongo.Connection()
db = conn.test
fs = gridfs.GridFS(db)
 
for i in range(0, 100):
filename = str(count + i) + ".flv"
data = str(count + i)
fs.put(data, filename=filename)
print "inserted " + filename
 
conn.close()
 
def _spawn():
pid = os.fork()
if pid == 0:
_testgridfs()
exit(0)
 
if __name__ == "__main__":
for i in range(0, 2):
count += 10000
_spawn()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.