Update public source
This commit is contained in:
@@ -76,6 +76,50 @@ class JobIssuanceService:
|
||||
),
|
||||
}
|
||||
|
||||
def get_search_context_statistics(
|
||||
self,
|
||||
handshake_ids: list[int] | tuple[int, ...],
|
||||
method_id: str,
|
||||
method_version: int,
|
||||
) -> dict[str, int]:
|
||||
row = self._handshakes.get_search_context_statistics(
|
||||
handshake_ids,
|
||||
method_id,
|
||||
method_version,
|
||||
)
|
||||
|
||||
if row is None:
|
||||
return {
|
||||
"matched_count": 0,
|
||||
"valid_hash_count": 0,
|
||||
"found_count": 0,
|
||||
"covered_count": 0,
|
||||
"reserved_count": 0,
|
||||
"available_count": 0,
|
||||
"unsupported_count": 0,
|
||||
}
|
||||
|
||||
matched_count = int(row["matched_count"] or 0)
|
||||
valid_hash_count = int(row["valid_hash_count"] or 0)
|
||||
found_count = int(row["found_count"] or 0)
|
||||
covered_count = int(row["covered_count"] or 0)
|
||||
reserved_count = int(row["reserved_count"] or 0)
|
||||
|
||||
return {
|
||||
"matched_count": matched_count,
|
||||
"valid_hash_count": valid_hash_count,
|
||||
"found_count": found_count,
|
||||
"covered_count": covered_count,
|
||||
"reserved_count": reserved_count,
|
||||
"available_count": (
|
||||
valid_hash_count
|
||||
- found_count
|
||||
- covered_count
|
||||
- reserved_count
|
||||
),
|
||||
"unsupported_count": matched_count - valid_hash_count,
|
||||
}
|
||||
|
||||
def issue_job(
|
||||
self,
|
||||
method_id: str,
|
||||
|
||||
Reference in New Issue
Block a user