Skip to content

Instantly share code, notes, and snippets.

@opie4624
Created February 29, 2012 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opie4624/1938854 to your computer and use it in GitHub Desktop.
Save opie4624/1938854 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#
import time
from couchdbcurl import client
for i in range(4,10):
s = client.Server("http://server%s.local:5984/"%i)
print "Server %s" % i
for d in s:
while len(s.tasks()) > 10:
print " %s tasks running. Waiting a minute..." % len(s.tasks())
time.sleep(60)
print " Compacting %s" % d
s[d].compact()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment