Skip to content

Commit

Permalink
[release/2024-11-20] more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jaklinger committed Nov 22, 2024
1 parent aeb3ddf commit 01302a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layers/domain/repository/repository/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ def _split_transactions_by_key(
item = transaction_statement.Key or transaction_statement.Item
key = (item["pk"]["S"], item["sk"]["S"])
if key in keys:
print("ooo> Batch writing keys", keys) # noqa
yield from batched(buffer, n=n_max)
buffer, keys = [], set()
buffer.append(transact_item)
keys.add(key)
print("ooo> Batch writing keys", keys) # noqa
yield from batched(buffer, n=n_max)


Expand All @@ -101,6 +103,7 @@ def transact_write_chunk(
transaction = Transaction(TransactItems=chunk)
with handle_client_errors(commands=chunk):
_response = client.transact_write_items(**transaction.dict(exclude_none=True))
print("ooo> DB Response", _response) # noqa
return _response


Expand Down Expand Up @@ -141,7 +144,7 @@ def generate_transaction_statements(event):
handler_name = f"handle_{type(event).__name__}"
handler = getattr(self, handler_name)
transact_items = handler(event=event)

print(f"ooo> Handler {handler_name} --> {transact_items}") # noqa
if not isinstance(transact_items, list):
transact_items = [transact_items]
return transact_items
Expand Down
1 change: 1 addition & 0 deletions src/layers/domain/repository/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def update_transactions(
transact_items = [
TransactItem(Update=update_statement(Key=key)) for key in primary_keys
]
print(f"ooo> Issuing transactions {transact_items}") # noqa
return transact_items


Expand Down

0 comments on commit 01302a6

Please sign in to comment.