Fix a problem with typechecking.
Using remote_write() isn't quite right given move to HTTP, but can fight that battle another day.
This commit is contained in:
parent
e2636466b5
commit
4c11177387
|
@ -252,9 +252,6 @@ class BucketWriter(Referenceable): # type: ignore # warner/foolscap#78
|
||||||
return self._max_size
|
return self._max_size
|
||||||
|
|
||||||
def remote_write(self, offset, data):
|
def remote_write(self, offset, data):
|
||||||
self.write(offset, data)
|
|
||||||
|
|
||||||
def write(self, offset, data):
|
|
||||||
# Delay the timeout, since we received data:
|
# Delay the timeout, since we received data:
|
||||||
self._timeout.reset(30 * 60)
|
self._timeout.reset(30 * 60)
|
||||||
start = self._clock.seconds()
|
start = self._clock.seconds()
|
||||||
|
|
|
@ -319,7 +319,7 @@ class Bucket(unittest.TestCase):
|
||||||
# 20 minutes pass, getting close to the timeout...
|
# 20 minutes pass, getting close to the timeout...
|
||||||
clock.advance(29 * 60)
|
clock.advance(29 * 60)
|
||||||
# .. but we receive a write! So that should delay the timeout.
|
# .. but we receive a write! So that should delay the timeout.
|
||||||
bw.write(0, b"hello")
|
bw.remote_write(0, b"hello")
|
||||||
self._assert_timeout_only_after_30_minutes(clock, bw)
|
self._assert_timeout_only_after_30_minutes(clock, bw)
|
||||||
|
|
||||||
def test_bucket_closing_cancels_timeout(self):
|
def test_bucket_closing_cancels_timeout(self):
|
||||||
|
|
Loading…
Reference in New Issue