diff options
author | Erik Johnston <erik@matrix.org> | 2018-01-18 11:07:17 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-01-18 11:07:17 +0000 |
commit | dc519602ac0f35d39a70c91f0e6057e865a61dfc (patch) | |
tree | 4dc209db7a90930f948a0dcc26f55ed414cfcf73 /synapse/util | |
parent | Fix _notify_empty typo (diff) | |
download | synapse-dc519602ac0f35d39a70c91f0e6057e865a61dfc.tar.xz |
Ensure we registerProducer isn't called twice
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/file_consumer.py | 3 |
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) |