Amazon Lex在Lambda Fullfilment上的计时时间为30秒 [英] Amazon Lex Timing out in 30 seconds on Lambda Fullfilment

查看:119
本文介绍了Amazon Lex在Lambda Fullfilment上的计时时间为30秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个lambda函数,该函数通过Web服务与某些外部自动化相关联.大约需要45秒才能完成任务.

I have a lambda function which is tied to some external automation via a webservice. It takes about 45 seconds for the task to be completed.

我已经将lambda调用的时间限制更新为2分钟,并且在我测试时可以正常使用.

I have already updated the time limitation for the lambda call to 2 mins and when I am testing it works fine.

但是,当我在Amazon Lex中使用文本bot时,会收到以下消息:

However, when I am using the text bot in Amazon Lex I get the following message:

发生错误:Bot配置无效:Lambda请求未在允许的时间(30秒)内完成.

An error has occurred: Invalid Bot Configuration: Lambda request did not complete within permissible time (30 seconds).

任何人都知道如何增加Lex Bot配置以使我的lambda脚本至少持续1分钟吗?

Anyone know how to increase the Lex Bot Configuration to give my lambda script up to at least 1 minute ?

谢谢

推荐答案

能否在此详细说明您要实现的目标?从哲学上讲,机器人应该具有响应能力,因此Lex对lambda调用设置了这样的时间限制是可以理解的.我建议以最终用户探测该机器人以进行更新的方式对机器人进行建模(这就像从固定用户那里轮询此处查找的响应一样).在lambda中,请求处理应异步进行.例如,当lambda收到请求时,则:

Can you elaborate more on what you are trying to achieve here? Philosophically a bot should be responsive and hence Lex understandably put such a time limit on the lambda call. I would recommend to model the bot in a way that end user probes the bot for update (which is like polling from the ned user for the response being looked here). In the lambda the request processing should happen asynchronously. For example when the lambda gets a request then:

  • 您可以为请求创建一个UUID并异步处理该请求(将请求放入另一个Lambda选择的SQS上并进行类似处理).
  • 将UUID返回给最终用户,说是请求ID.请在几秒钟后检查此作业的状态.".
  • 最终用户将继续检查请求状态为什么状态"的结果.对于这样的话语,您可以有另一个意图,该意图会触发lambda检查响应.同时,可以将在步骤1中执行的处理的响应发布到S3或放入数据库中(使用UUID作为该数据的标识符).当前的lambda可以探测S3或数据库以获取结果并将其返回.

这篇关于Amazon Lex在Lambda Fullfilment上的计时时间为30秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆