Update public source

This commit is contained in:
2026-10-13 08:00:22 +03:00
parent a0ad384f1e
commit 4876d2de9c
3 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class JobPackageService:
job_id = validated.job["job_id"] job_id = validated.job["job_id"]
job_path = ( job_path = (
self._paths.jobs self._paths.jobs
/ package_path.stem / job_id
) )
if job_path.exists(): if job_path.exists():
+26 -8
View File
@@ -13,9 +13,32 @@ class HandshakesRepository:
method_id: str, method_id: str,
method_version: int, method_version: int,
limit: int | None, limit: int | None,
handshake_ids: list[int] | tuple[int, ...] | None = None,
) -> list[sqlite3.Row]: ) -> list[sqlite3.Row]:
if handshake_ids is not None and not handshake_ids:
return []
id_filter = ""
parameters: list[Any] = [
method_id,
method_version,
method_id,
method_version,
]
if handshake_ids is not None:
placeholders = ", ".join(
"?" for _ in handshake_ids
)
id_filter = f"AND h.id IN ({placeholders})"
parameters.extend(handshake_ids)
parameters.append(
limit if limit is not None else -1
)
return self._conn.execute( return self._conn.execute(
""" f"""
SELECT SELECT
h.id AS handshake_id, h.id AS handshake_id,
h.hash22000, h.hash22000,
@@ -45,16 +68,11 @@ class HandshakesRepository:
AND r.method_version = ? AND r.method_version = ?
AND r.status = 'ACTIVE' AND r.status = 'ACTIVE'
) )
{id_filter}
ORDER BY h.id ORDER BY h.id
LIMIT ? LIMIT ?
""", """,
( parameters,
method_id,
method_version,
method_id,
method_version,
limit if limit is not None else -1,
),
).fetchall() ).fetchall()
def get_method_statistics( def get_method_statistics(
+2
View File
@@ -82,6 +82,7 @@ class JobIssuanceService:
method_version: int, method_version: int,
limit: int | None, limit: int | None,
client_id: str | None = None, client_id: str | None = None,
handshake_ids: list[int] | tuple[int, ...] | None = None,
) -> IssuedJob | None: ) -> IssuedJob | None:
if limit is not None and limit <= 0: if limit is not None and limit <= 0:
raise ValueError("limit must be greater than zero") raise ValueError("limit must be greater than zero")
@@ -111,6 +112,7 @@ class JobIssuanceService:
method_id, method_id,
method_version, method_version,
limit, limit,
handshake_ids,
) )
if not handshake_rows: if not handshake_rows: