Add missing await to sleep calls (#18763)
This commit is contained in:
parent
3b5b6f6152
commit
510924a2f6
1
changelog.d/18763.bugfix
Normal file
1
changelog.d/18763.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix an issue that could cause logcontexts to be lost on rate-limited requests. Found by @realtyem.
|
||||
@ -337,7 +337,7 @@ class _AsyncResource(resource.Resource, metaclass=abc.ABCMeta):
|
||||
callback_return = await self._async_render(request)
|
||||
except LimitExceededError as e:
|
||||
if e.pause:
|
||||
self._clock.sleep(e.pause)
|
||||
await self._clock.sleep(e.pause)
|
||||
raise
|
||||
|
||||
if callback_return is not None:
|
||||
|
||||
@ -1031,7 +1031,7 @@ class DeviceInboxWorkerStore(SQLBaseStore):
|
||||
|
||||
# We sleep a bit so that we don't hammer the database in a tight
|
||||
# loop first time we run this.
|
||||
self._clock.sleep(1)
|
||||
await self._clock.sleep(1)
|
||||
|
||||
async def get_devices_with_messages(
|
||||
self, user_id: str, device_ids: StrCollection
|
||||
|
||||
Loading…
Reference in New Issue
Block a user