forked from MirrorHub/synapse
Ensure we registerProducer isn't called twice
This commit is contained in:
parent
17b54389fe
commit
dc519602ac
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue