Add DeferredCache.get_immediate method (#8568)

* Add `DeferredCache.get_immediate` method

A bunch of things that are currently calling `DeferredCache.get` are only
really interested in the result if it's completed. We can optimise and simplify
this case.

* Remove unused 'default' parameter to DeferredCache.get()

* another get_immediate instance
This commit is contained in:
Richard van der Hoff 2020-10-19 15:00:12 +01:00 committed by GitHub
parent c356b4bf42
commit 903d11c43a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 27 deletions

View file

@ -303,7 +303,7 @@ class PusherStore(PusherWorkerStore):
lock=False,
)
user_has_pusher = self.get_if_user_has_pusher.cache.get(
user_has_pusher = self.get_if_user_has_pusher.cache.get_immediate(
(user_id,), None, update_metrics=False
)