summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-01-18 11:07:17 +0000
committerErik Johnston <erik@matrix.org>2018-01-18 11:07:17 +0000
commitdc519602ac0f35d39a70c91f0e6057e865a61dfc (patch)
tree4dc209db7a90930f948a0dcc26f55ed414cfcf73
parentFix _notify_empty typo (diff)
downloadsynapse-dc519602ac0f35d39a70c91f0e6057e865a61dfc.tar.xz
Ensure we registerProducer isn't called twice
-rw-r--r--synapse/util/file_consumer.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/util/file_consumer.py b/synapse/util/file_consumer.py
index 479e480614..d7bbb0aeb8 100644
--- a/synapse/util/file_consumer.py
+++ b/synapse/util/file_consumer.py
@@ -69,6 +69,9 @@ class BackgroundFileConsumer(object):
             streaming (bool): True if push based producer, False if pull
                 based.
         """
+        if self.producer:
+            raise Exception("registerProducer called twice")
+
         self.producer = producer
         self.streaming = streaming
         self.finished_deferred = threads.deferToThread(self._writer)