Stop a Lambda function in Python

我的梦境 提交于 2020-01-03 10:46:26

问题


Inside a certain function I want to stop the whole Lambda process but not trigger an error. I've tried looking at the context variable to stop it or just calling exit() but each time it's treated as an error which I don't want to track.

How can I end successfully a Lambda process in Python?


回答1:


In AWS Lambda you define a handler function and in Python a function just needs to return in order to complete successfully, where return implies return None.

What you've done is correct, just have multiple return points in that handler function. You can always log messages for different reasons for the function completing if needed.



来源:https://stackoverflow.com/questions/51780706/stop-a-lambda-function-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!