From 1ba241e07159ee956f9d04bbdc450f42484110c1 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 3 Dec 2006 00:53:38 -0700 Subject: [PATCH] encode: delay completion until all our messages have been delivered --- allmydata/encode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/allmydata/encode.py b/allmydata/encode.py index 946db1e0..a9b3d475 100644 --- a/allmydata/encode.py +++ b/allmydata/encode.py @@ -7,9 +7,10 @@ class Encoder(object): self.m = m def do_upload(self, landlords): + dl = [] data = self.infile.read() for (peerid, bucket_num, remotebucket) in landlords: - remotebucket.callRemote('write', data) - remotebucket.callRemote('finalise') + dl.append(remotebucket.callRemote('write', data)) + dl.append(remotebucket.callRemote('close')) - return defer.succeed() + return defer.DeferredList(dl) -- 2.45.2