summary refs log tree commit diff
path: root/synapse/util/async.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-06-14 18:27:37 +1000
committerGitHub <noreply@github.com>2018-06-14 18:27:37 +1000
commita61738b316db70a4184d5c355696e0a039e7867f (patch)
treecaca1a3ef0267aad2827f2f46755161d41f2ad5a /synapse/util/async.py
parentMerge pull request #3368 from matrix-org/rav/fix_federation_client_host (diff)
downloadsynapse-a61738b316db70a4184d5c355696e0a039e7867f.tar.xz
Remove run_on_reactor (#3395)
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r--synapse/util/async.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py
index 9dd4e6b5bc..b8e57efc54 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -13,7 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 from twisted.internet import defer, reactor
 from twisted.internet.defer import CancelledError
 from twisted.python import failure
@@ -41,13 +40,6 @@ def sleep(seconds):
     defer.returnValue(res)
 
 
-def run_on_reactor():
-    """ This will cause the rest of the function to be invoked upon the next
-    iteration of the main loop
-    """
-    return sleep(0)
-
-
 class ObservableDeferred(object):
     """Wraps a deferred object so that we can add observer deferreds. These
     observer deferreds do not affect the callback chain of the original
@@ -227,7 +219,7 @@ class Linearizer(object):
             # the context manager, but it needs to happen while we hold the
             # lock, and the context manager's exit code must be synchronous,
             # so actually this is the only sensible place.
-            yield run_on_reactor()
+            yield sleep(0)
 
         else:
             logger.info("Acquired uncontended linearizer lock %r for key %r",