问题描述
我有一个AWS
Lambda函数针对Kinesis Firehose
执行操作.该函数使用退避机制. (这一次我认为是在浪费我的计算时间).
I have an AWS
Lambda function does operations against Kinesis Firehose
.The function uses backoff mechanism. (which at this time I think wasting my computation time).
但是无论如何,在我的代码中的某些时候,我想使执行失败.我应该使用什么命令来使执行停止?
But anyway, in some point in my code, I would like to fail the execution.What command should I use in order to make the execution stop?
P.s.我发现有一些命令,例如:
P.s.I found out that there are commands such as:
-
context.done()
-
context.succeed()
-
context.fail()
context.done()
context.succeed()
context.fail()
我必须告诉您,我无法在AWS
文档中找到有关这些命令的任何文档.
I've got to tell you, I could not find any documentation about these commands in AWS
documentation.
推荐答案
这些方法仅用于向后兼容,因为它们是在Node.js v0.10.42中首次引入的.如果您使用NodeJS版本4. *或6. *.使用callback()
功能.
Those methods are available only for backward compatibility, since they were first introduced with Node.js v0.10.42. If you use NodeJS version 4.* or 6.*. Use the callback()
function.
检查:在Lambda中使用回调参数以获取更多有关如何利用此功能的信息.
Check: Using the Callback Parameter in Lambda for more information how to take advantage of this function.
这篇关于如何使AWS Lambda停止执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!