1
0

Add type ignore unused-awaitable to run_in_background calls

This commit is contained in:
Mathieu Velten
2022-11-22 17:15:02 +01:00
parent a0dfa69ffc
commit b0603dabc9
7 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -406,10 +406,10 @@ class _TransactionController:
if sent:
await txn.complete(self.store)
else:
run_in_background(self._on_txn_fail, service)
run_in_background(self._on_txn_fail, service) # type: ignore[unused-awaitable]
except Exception:
logger.exception("Error creating appservice transaction")
run_in_background(self._on_txn_fail, service)
run_in_background(self._on_txn_fail, service) # type: ignore[unused-awaitable]
async def on_recovered(self, recoverer: "_Recoverer") -> None:
logger.info(
+1 -1
View File
@@ -132,7 +132,7 @@ class Authenticator:
# alive
retry_timings = await self.store.get_destination_retry_timings(origin)
if retry_timings and retry_timings.retry_last_ts:
run_in_background(self.reset_retry_timings, origin)
run_in_background(self.reset_retry_timings, origin) # type: ignore[unused-awaitable]
return origin
+1 -1
View File
@@ -198,7 +198,7 @@ class DeviceMessageHandler:
await self.store.mark_remote_user_device_cache_as_stale(sender_user_id)
# Immediately attempt a resync in the background
run_in_background(self._user_device_resync, user_id=sender_user_id)
run_in_background(self._user_device_resync, user_id=sender_user_id) # type: ignore[unused-awaitable]
async def send_device_message(
self,
+2 -2
View File
@@ -1918,7 +1918,7 @@ class EventCreationHandler:
if event.type == EventTypes.Message:
# We don't want to block sending messages on any presence code. This
# matters as sometimes presence code can take a while.
run_in_background(self._bump_active_time, requester.user)
run_in_background(self._bump_active_time, requester.user) # type: ignore[unused-awaitable]
async def _notify() -> None:
try:
@@ -1928,7 +1928,7 @@ class EventCreationHandler:
except Exception:
logger.exception("Error notifying about new room events")
run_in_background(_notify)
run_in_background(_notify) # type: ignore[unused-awaitable]
return persisted_events[-1]
+1 -1
View File
@@ -1060,7 +1060,7 @@ class PresenceHandler(BasePresenceHandler):
yield
finally:
if affect_presence:
run_in_background(_end)
run_in_background(_end) # type: ignore[unused-awaitable]
return _user_syncing()
+1 -1
View File
@@ -757,7 +757,7 @@ def respond_with_json(
if send_cors:
set_cors_headers(request)
run_in_background(
run_in_background( # type: ignore[unused-awaitable]
_async_write_json_to_request_in_thread, request, encoder, json_object
)
return NOT_DONE_YET
+1 -1
View File
@@ -112,7 +112,7 @@ class StorageProviderWrapper(StorageProvider):
except Exception:
logger.exception("Error storing file")
run_in_background(store)
run_in_background(store) # type: ignore[unused-awaitable]
async def fetch(self, path: str, file_info: FileInfo) -> Optional[Responder]:
if file_info.url_cache: