Ensure we registerProducer isn't called twice

pull/2804/head
Erik Johnston 2018-01-18 11:07:17 +00:00
parent 17b54389fe
commit dc519602ac
1 changed files with 3 additions and 0 deletions

View File

@ -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)