Update Python tools

This commit is contained in:
ajp_anton
2026-08-09 02:31:54 +00:00
parent b0c707d624
commit 6d28257b54
10 changed files with 362 additions and 12 deletions
+15
View File
@@ -133,6 +133,21 @@ class RunStore:
)
return self.get(cursor.lastrowid, connection=connection), True
def set_input(
self,
run_id: int,
input_data: Mapping[str, str | int | list[str]],
) -> Run:
input_json = json.dumps(input_data, sort_keys=True, separators=(",", ":"))
with self._connect() as connection:
connection.execute(
"UPDATE runs SET input_json = ? WHERE id = ?",
(input_json, run_id),
)
run = self.get(run_id, connection=connection)
assert run is not None
return run
def claim_next(self, queue_group: str) -> Run | None:
with self._connect() as connection:
connection.execute("BEGIN IMMEDIATE")