Move geo cache commit handling into repository layer
This commit is contained in:
@@ -156,9 +156,23 @@ class GeoCacheRepository(Protocol):
|
||||
) -> None:
|
||||
...
|
||||
|
||||
async def upsert_entry_and_commit(
|
||||
self,
|
||||
db: aiosqlite.Connection,
|
||||
ip: str,
|
||||
country_code: str | None,
|
||||
country_name: str | None,
|
||||
asn: str | None,
|
||||
org: str | None,
|
||||
) -> None:
|
||||
...
|
||||
|
||||
async def upsert_neg_entry(self, db: aiosqlite.Connection, ip: str) -> None:
|
||||
...
|
||||
|
||||
async def upsert_neg_entry_and_commit(self, db: aiosqlite.Connection, ip: str) -> None:
|
||||
...
|
||||
|
||||
async def bulk_upsert_entries(
|
||||
self,
|
||||
db: aiosqlite.Connection,
|
||||
@@ -166,9 +180,27 @@ class GeoCacheRepository(Protocol):
|
||||
) -> int:
|
||||
...
|
||||
|
||||
async def bulk_upsert_entries_and_commit(
|
||||
self,
|
||||
db: aiosqlite.Connection,
|
||||
rows: Iterable[tuple[str, str | None, str | None, str | None, str | None]],
|
||||
) -> int:
|
||||
...
|
||||
|
||||
async def bulk_upsert_neg_entries(self, db: aiosqlite.Connection, ips: list[str]) -> int:
|
||||
...
|
||||
|
||||
async def bulk_upsert_neg_entries_and_commit(self, db: aiosqlite.Connection, ips: list[str]) -> int:
|
||||
...
|
||||
|
||||
async def bulk_upsert_entries_and_neg_entries_and_commit(
|
||||
self,
|
||||
db: aiosqlite.Connection,
|
||||
rows: Iterable[tuple[str, str | None, str | None, str | None, str | None]],
|
||||
ips: list[str],
|
||||
) -> tuple[int, int]:
|
||||
...
|
||||
|
||||
|
||||
class HistoryArchiveRepository(Protocol):
|
||||
"""Protocol for archived ban history persistence operations."""
|
||||
|
||||
Reference in New Issue
Block a user