You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run it and check /aws/lambda/chalice-lambda_context-poc-dev-scheduled log group, there is an error raised in the second print statement:
'NoneType' object has no attribute 'invoked_function_arn': AttributeError
Traceback (most recent call last):
File "/var/task/chalice/app.py", line 1130, in __call__
return self.func(event_obj)
File "/var/task/app.py", line 13, in scheduled
print('app.lambda_context.invoked_function_arn: ' + app.lambda_context.invoked_function_arn)
AttributeError: 'NoneType' object has no attribute 'invoked_function_arn'
So it seems we can't access app.lambda_context from methods decorated by @app.schedule.
I think it's quite confusing as not obvious from the documentation which states app.lambda_context is available always.
Yes this is intentional, I updated the documentation to reflect this, the code that Kyle wrote in the comment you linked was a suggestion, not how it worked, or works now.
Hi,
I've just examined this issue - still have questions, but the issue is closed now, so I've decided to create a new one.
The following stated in the issue:
I believe it't not true as I wasn't able to call app.lambda_context from a method decorated by @app.schedule.
I've tried the following code:
If you run it and check
/aws/lambda/chalice-lambda_context-poc-dev-scheduled
log group, there is an error raised in the second print statement:So it seems we can't access app.lambda_context from methods decorated by @app.schedule.
I think it's quite confusing as not obvious from the documentation which states app.lambda_context is available always.
If this is by design, I assume it should be mentioned in the docs on page
https://chalice.readthedocs.io/en/latest/api.html
The text was updated successfully, but these errors were encountered: