fix timeout bug
This commit is contained in:
@@ -77,9 +77,14 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
},
|
||||
cls=Encoder,
|
||||
)
|
||||
# Send template URI and data to Paperforge API to generate a PDF
|
||||
r = requests.post(PAPERFORGE_API, data=json_data)
|
||||
r.raise_for_status()
|
||||
|
||||
try:
|
||||
# Send template URI and data to Paperforge API to generate a PDF
|
||||
r = requests.post(PAPERFORGE_API, data=json_data, timeout=6)
|
||||
r.raise_for_status()
|
||||
except requests.exceptions.Timeout:
|
||||
logger.info('The request timed out')
|
||||
raise
|
||||
|
||||
emailmsg = Message(
|
||||
from_=EMAIL_SENDER,
|
||||
|
||||
@@ -366,6 +366,7 @@ Resources:
|
||||
Type: AWS::Serverless::Function
|
||||
Properties:
|
||||
Handler: events.reporting.send_report_email.lambda_handler
|
||||
Timeout: 12
|
||||
LoggingConfig:
|
||||
LogGroup: !Ref EventLog
|
||||
Policies:
|
||||
|
||||
Reference in New Issue
Block a user