MCPcopy Create free account
hub / github.com/cosdata/cosdata / commit_transaction

Function commit_transaction

tests/test-key-value-store.py:53–57  ·  view source on GitHub ↗
(name, txn_id)

Source from the content-addressed store, hash-verified

51 return response.json()["transaction_id"]
52
53def commit_transaction(name, txn_id):
54 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/commit"
55 response = requests.post(url, headers=client._get_headers(), verify=client.verify_ssl)
56 if response.status_code not in [200, 204]:
57 raise Exception(f"Failed to commit transaction: {response.text}")
58
59def abort_transaction(name, txn_id):
60 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/abort"

Callers 1

run_in_txnFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected