Standardize async offloading behind shared executor helper
This commit is contained in:
@@ -7,6 +7,7 @@ fail2ban socket operations.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from app.utils.async_utils import run_blocking
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
@@ -70,7 +71,7 @@ async def preview_log(req: LogPreviewRequest) -> LogPreviewResponse:
|
||||
)
|
||||
|
||||
try:
|
||||
raw_lines = await asyncio.get_event_loop().run_in_executor(
|
||||
raw_lines = await run_blocking(
|
||||
None,
|
||||
_read_tail_lines,
|
||||
str(path),
|
||||
|
||||
Reference in New Issue
Block a user