mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Ruff
This commit is contained in:
@@ -15,13 +15,13 @@ from collections import (
|
||||
defaultdict,
|
||||
OrderedDict,
|
||||
)
|
||||
from collections.abc import Iterator
|
||||
from datetime import (
|
||||
datetime,
|
||||
timedelta,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
Iterator,
|
||||
Optional,
|
||||
)
|
||||
|
||||
@@ -120,7 +120,7 @@ class HistoryAuditMonitor:
|
||||
self._thread: Optional[threading.Thread] = None
|
||||
self._active = False
|
||||
# Bounded LRU cache: history_id -> user_id, refreshed on miss.
|
||||
self._history_owner_cache: "OrderedDict[int, int]" = OrderedDict()
|
||||
self._history_owner_cache: OrderedDict[int, int] = OrderedDict()
|
||||
|
||||
def start(self) -> None:
|
||||
if self._active:
|
||||
|
||||
@@ -8,12 +8,14 @@ to async SSE endpoint handlers running in the uvicorn event loop.
|
||||
import asyncio
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
from collections.abc import (
|
||||
AsyncIterator,
|
||||
Awaitable,
|
||||
Callable,
|
||||
)
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ configuration. When notifications are disabled the catch-up event is simply
|
||||
skipped; the stream still delivers other push events.
|
||||
"""
|
||||
|
||||
from collections.abc import AsyncIterator
|
||||
from typing import (
|
||||
AsyncIterator,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from collections.abc import AsyncIterator
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
AsyncIterator,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Union,
|
||||
|
||||
@@ -71,7 +71,7 @@ class SSELineListener:
|
||||
self._collected: list[str] = []
|
||||
self._stop = threading.Event()
|
||||
self._ready = threading.Event()
|
||||
self._errors: "queue.Queue[BaseException]" = queue.Queue()
|
||||
self._errors: queue.Queue[BaseException] = queue.Queue()
|
||||
self._thread = threading.Thread(target=self._listen, daemon=True)
|
||||
|
||||
def start(self) -> None:
|
||||
@@ -130,7 +130,7 @@ class SSELineListener:
|
||||
if self._stop.is_set():
|
||||
break
|
||||
resp.close()
|
||||
except BaseException as exc:
|
||||
except Exception as exc:
|
||||
self._errors.put(exc)
|
||||
# Ensure start() doesn't hang forever on connection failure.
|
||||
self._ready.set()
|
||||
|
||||
@@ -129,5 +129,7 @@ class TestNotificationSSESeleniumIntegration(SeleniumIntegrationTestCase):
|
||||
|
||||
self._wait_for_sse_event_after(baseline_ts)
|
||||
# The indicator dot should appear on the bell (within the #activity-notifications element)
|
||||
self.driver.wait_for_selector_visible("#activity-notifications .indicator", timeout=SSE_EVENT_TIMEOUT_SECONDS * 1000)
|
||||
self.driver.wait_for_selector_visible(
|
||||
"#activity-notifications .indicator", timeout=SSE_EVENT_TIMEOUT_SECONDS * 1000
|
||||
)
|
||||
self.screenshot("notification_bell_indicator")
|
||||
|
||||
Reference in New Issue
Block a user