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

Function commit_transaction

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

Source from the content-addressed store, hash-verified

83 return transaction_id
84
85def commit_transaction(name, txn_id):
86 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/commit"
87 response = requests.post(
88 url,
89 headers=client._get_headers(),
90 verify=client.verify_ssl,
91 )
92
93 if response.status_code not in [200, 204]:
94 raise Exception(f"Failed to commit transaction: {response.text}")
95
96def abort_transaction(name, txn_id):
97 url = f"{client.base_url}/collections/{name}/transactions/{txn_id}/abort"

Callers 1

mainFunction · 0.70

Calls 1

_get_headersMethod · 0.45

Tested by

no test coverage detected