This commit is contained in:
2025-11-11 17:06:25 -03:00
parent c00a42ea39
commit 39aedac972
30 changed files with 802 additions and 220 deletions

View File

@@ -10,7 +10,7 @@ from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
from boto3clients import dynamodb_client
from config import API_URL, COURSE_TABLE
course_layer = DynamoDBPersistenceLayer(COURSE_TABLE, dynamodb_client)
dyn = DynamoDBPersistenceLayer(COURSE_TABLE, dynamodb_client)
@event_source(data_class=DynamoDBStreamEvent)
@@ -21,7 +21,7 @@ def lambda_handler(event: DynamoDBStreamEvent, context: LambdaContext) -> bool:
data = r.json()
now_ = now()
with course_layer.transact_writer() as transact:
with dyn.transact_writer() as transact:
for course in data:
transact.update(
key=KeyPair(course['id'], '0'),