add cert_expires_at
This commit is contained in:
@@ -24,7 +24,7 @@ order_layer = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
new_image = event.detail['new_image']
|
||||
now_ = now()
|
||||
data = user_layer.collection.get_items(
|
||||
r = user_layer.collection.get_items(
|
||||
KeyPair(
|
||||
pk='cnpj',
|
||||
sk=SortKey(new_image['cnpj'], path_spec='user_id'),
|
||||
@@ -40,10 +40,10 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
|
||||
# Sometimes the function executes before the user insertion completes,
|
||||
# so an exception is raised to trigger a retry.
|
||||
if len(data) < 2:
|
||||
if len(r) < 2:
|
||||
raise ValueError('IDs not found')
|
||||
|
||||
logger.info('IDs found', data=data)
|
||||
logger.info('IDs found', result=r)
|
||||
|
||||
with order_layer.transact_writer() as transact:
|
||||
transact.update(
|
||||
@@ -52,7 +52,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
# Post-migration: uncomment the following line
|
||||
# update_expr='SET org_id = :org_id, updated_at = :updated_at',
|
||||
expr_attr_values={
|
||||
':org_id': data['org_id'],
|
||||
':org_id': r['org_id'],
|
||||
':updated_at': now_,
|
||||
},
|
||||
)
|
||||
@@ -61,7 +61,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
key=KeyPair(new_image['id'], 'author'),
|
||||
update_expr='SET user_id = :user_id, updated_at = :updated_at',
|
||||
expr_attr_values={
|
||||
':user_id': data['user_id'],
|
||||
':user_id': r['user_id'],
|
||||
':updated_at': now_,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user