fix auto-flush behavior

This commit is contained in:
James Turk 2012-04-13 23:44:36 -04:00
parent 95a92d124c
commit 574d1da843

View File

@ -37,9 +37,9 @@ class CloudSearch(object):
newjson = json.dumps(newdoc)
newsize = len(newjson)
if ((self._current_size + newsize > self.MAX_BYTES) or
(self._flush_every and len(self._current_batch > self._flush_every)
)):
if (self._current_size + newsize > self.MAX_BYTES or
(self._flush_every and
len(self._current_batch) > self._flush_every)):
self.flush()
self._current_batch.append(json.dumps(newdoc))