Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe * fix lint * Fix typing * Fix tests * Fix black
This commit is contained in:
parent
f4a1f2809b
commit
c1851a2d94
23 changed files with 196 additions and 232 deletions
|
@ -8,8 +8,6 @@ import threading
|
|||
import traceback
|
||||
from typing import Any, Callable, Coroutine, Optional
|
||||
|
||||
from .async_ import run_coroutine_threadsafe
|
||||
|
||||
|
||||
class HideSensitiveDataFilter(logging.Filter):
|
||||
"""Filter API password calls."""
|
||||
|
@ -83,7 +81,9 @@ class AsyncHandler:
|
|||
def _process(self) -> None:
|
||||
"""Process log in a thread."""
|
||||
while True:
|
||||
record = run_coroutine_threadsafe(self._queue.get(), self.loop).result()
|
||||
record = asyncio.run_coroutine_threadsafe(
|
||||
self._queue.get(), self.loop
|
||||
).result()
|
||||
|
||||
if record is None:
|
||||
self.handler.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue