Skip to content

Commit d8e6c1a

Browse files
committed
skip publishers without sources
1 parent 9c8d656 commit d8e6c1a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/publisher_coverage.py

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ def main() -> None:
3232
):
3333
publisher_name: str = publisher.name # type: ignore[attr-defined]
3434

35+
if not any(publisher.source_mapping.values()): # type: ignore[attr-defined]
36+
# skip publishers providing no sources for forward crawling
37+
print(f"⏩ SKIPPED: {publisher_name!r} - No sources defined")
38+
continue
39+
3540
crawler: Crawler = Crawler(publisher, delay=0.4)
3641

3742
timed_next = timeout(next, time=20, silent=True)

scripts/utility.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ def _interrupt_handler() -> None:
1414

1515

1616
@overload
17-
def timeout(func: Callable[P, T], time: int, silent: Literal[False] = ...) -> Callable[P, T]:
17+
def timeout(func: Callable[P, T], time: float, silent: Literal[False] = ...) -> Callable[P, T]:
1818
...
1919

2020

2121
@overload
22-
def timeout(func: Callable[P, T], time: int, silent: Literal[True]) -> Callable[P, Optional[T]]:
22+
def timeout(func: Callable[P, T], time: float, silent: Literal[True]) -> Callable[P, Optional[T]]:
2323
...
2424

2525

26-
def timeout(func: Callable[P, T], time: int, silent: bool = False) -> Callable[P, Optional[T]]:
26+
def timeout(func: Callable[P, T], time: float, silent: bool = False) -> Callable[P, Optional[T]]:
2727
@wraps(func)
2828
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Optional[T]:
2929
# register interrupt handler

0 commit comments

Comments
 (0)