summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-01-18 11:04:41 +0000
committerErik Johnston <erik@matrix.org>2018-01-18 11:04:41 +0000
commit28b338ed9bafc2017a635848e14a2a25b78d0016 (patch)
tree83d387ae1662637c1a4403ad710ea3fac7c120dc
parentFix comments (diff)
downloadsynapse-28b338ed9bafc2017a635848e14a2a25b78d0016.tar.xz
Move definition of paused_producer to __init__
-rw-r--r--synapse/util/file_consumer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/file_consumer.py b/synapse/util/file_consumer.py
index 5284c7967e..54c9da9573 100644
--- a/synapse/util/file_consumer.py
+++ b/synapse/util/file_consumer.py
@@ -43,6 +43,10 @@ class BackgroundFileConsumer(object):
         # True if PushProducer, false if PullProducer
         self.streaming = False
 
+        # For PushProducers, indicates whether we've paused the producer and
+        # need to call resumeProducing before we get more data.
+        self.paused_producer = False
+
         # Queue of slices of bytes to be written. When producer calls
         # unregister a final None is sent.
         self.bytes_queue = Queue.Queue()
@@ -71,8 +75,6 @@ class BackgroundFileConsumer(object):
         if not streaming:
             self.producer.resumeProducing()
 
-        self.paused_producer = False
-
     def unregisterProducer(self):
         """Part of IProducer interface
         """