wip iugu
This commit is contained in:
@@ -12,7 +12,14 @@ from layercake.dateutils import now
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
|
||||
from boto3clients import dynamodb_client, s3_client
|
||||
from config import BILLING_TEMPLATE_URI, BUCKET_NAME, ORDER_TABLE, PAPERFORGE_API
|
||||
from config import (
|
||||
BILLING_TEMPLATE_URI,
|
||||
BUCKET_NAME,
|
||||
HTTP_CONNECT_TIMEOUT,
|
||||
HTTP_READ_TIMEOUT,
|
||||
ORDER_TABLE,
|
||||
PAPERFORGE_API,
|
||||
)
|
||||
|
||||
logger = Logger(__name__)
|
||||
order_layer = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
||||
@@ -50,7 +57,11 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
|
||||
try:
|
||||
# Send template URI and data to Paperforge API to generate a PDF
|
||||
r = requests.post(PAPERFORGE_API, data=json_data, timeout=6)
|
||||
r = requests.post(
|
||||
PAPERFORGE_API,
|
||||
data=json_data,
|
||||
timeout=(HTTP_CONNECT_TIMEOUT, HTTP_READ_TIMEOUT),
|
||||
)
|
||||
r.raise_for_status()
|
||||
except requests.exceptions.Timeout:
|
||||
logger.info('The request timed out')
|
||||
|
||||
Reference in New Issue
Block a user