mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 00:24:13 +00:00
More direct API.
This commit is contained in:
parent
1436eb0fb6
commit
17dfda6b5a
@ -121,7 +121,7 @@ class _WriteBuffer:
|
||||
and do a real write.
|
||||
"""
|
||||
self._to_write.write(data)
|
||||
return len(self._to_write.getbuffer()) >= self._batch_size
|
||||
return self._to_write.tell() >= self._batch_size
|
||||
|
||||
def flush(self) -> tuple[int, bytes]:
|
||||
"""Return offset and data to be written."""
|
||||
@ -133,7 +133,7 @@ class _WriteBuffer:
|
||||
|
||||
def get_total_bytes_queued(self) -> int:
|
||||
"""Return how many bytes were written or queued in total."""
|
||||
return self._written_bytes + len(self._to_write.getbuffer())
|
||||
return self._written_bytes + self._to_write.tell()
|
||||
|
||||
|
||||
@implementer(IStorageBucketWriter)
|
||||
|
Loading…
x
Reference in New Issue
Block a user