fix auto-flush behavior
This commit is contained in:
parent
95a92d124c
commit
574d1da843
@ -37,9 +37,9 @@ class CloudSearch(object):
|
|||||||
newjson = json.dumps(newdoc)
|
newjson = json.dumps(newdoc)
|
||||||
newsize = len(newjson)
|
newsize = len(newjson)
|
||||||
|
|
||||||
if ((self._current_size + newsize > self.MAX_BYTES) or
|
if (self._current_size + newsize > self.MAX_BYTES or
|
||||||
(self._flush_every and len(self._current_batch > self._flush_every)
|
(self._flush_every and
|
||||||
)):
|
len(self._current_batch) > self._flush_every)):
|
||||||
self.flush()
|
self.flush()
|
||||||
|
|
||||||
self._current_batch.append(json.dumps(newdoc))
|
self._current_batch.append(json.dumps(newdoc))
|
||||||
|
Loading…
Reference in New Issue
Block a user