summary refs log tree commit diff
path: root/synapse/util/file_consumer.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-04-30 00:34:28 +0100
committerGitHub <noreply@github.com>2018-04-30 00:34:28 +0100
commitaab2e4da60a11de3d84e9a603077cc43386db1f4 (patch)
treef3b6b59408b7ca4cd16925ff7f1f50785032872b /synapse/util/file_consumer.py
parentMerge pull request #3156 from NotAFile/py3-hmac-bytes (diff)
parentpep8; remove spurious import (diff)
downloadsynapse-aab2e4da60a11de3d84e9a603077cc43386db1f4.tar.xz
Merge pull request #3140 from matrix-org/rav/use_run_in_background
Use run_in_background in preference to preserve_fn
Diffstat (limited to 'synapse/util/file_consumer.py')
-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 3c8a165331..3380970e4e 100644
--- a/synapse/util/file_consumer.py
+++ b/synapse/util/file_consumer.py
@@ -15,7 +15,7 @@
 
 from twisted.internet import threads, reactor
 
-from synapse.util.logcontext import make_deferred_yieldable, preserve_fn
+from synapse.util.logcontext import make_deferred_yieldable, run_in_background
 
 from six.moves import queue
 
@@ -70,7 +70,9 @@ class BackgroundFileConsumer(object):
 
         self._producer = producer
         self.streaming = streaming
-        self._finished_deferred = preserve_fn(threads.deferToThread)(self._writer)
+        self._finished_deferred = run_in_background(
+            threads.deferToThread, self._writer
+        )
         if not streaming:
             self._producer.resumeProducing()