【问题标题】:IBM Watson Assistnat: Extend the Webhook's time when sending a webhook to a Cloud FunctionIBM Watson Assistant:在将 Webhook 发送到云函数时延长 Webhook 时间
【发布时间】:2021-08-12 07:41:07
【问题描述】:

在开发使用自己的样式的客户端应用程序时,在后台也使用IBM Watson Assistant,当超出 webhook 的时间时发现了问题。组成如下:客户端应用向Watson Assistant发送请求,助手从那里触发webhook,然后触发IBM Cloud Function

link 之后,一位男士可以看到其中一个常见问题解答中声明了时间限制(8 秒)不能延长。是否也包括拨打IBM Cloud Function的情况?

更新:

async function main(){
    try {
        const orders = await db.getOrders();
        if(orders.quantity > 0){
            return {data: 'there are some orders'};
        } else {
            return {data: 'there are no orders'};
        }
    } catch(err) {
        return {error: err.message};
    }
}

【问题讨论】:

    标签: node.js ibm-cloud watson-assistant openwhisk ibm-cloud-functions


    【解决方案1】:

    这是正确的,8 秒的限制仍然有效。未来很可能会改变

    【讨论】:

      【解决方案2】:

      抱歉,如果您已经这样做了,但为什么不从您的云功能返回一个承诺。这样一来,在您的 8 秒内返回几乎是立即的,但处理将变得异步。

      例如。

      function main (args) {
          return new Promise((resolve, reject) => {
            ...
          });
      }
      

      【讨论】:

      • 谢谢你的想法!
      • 我已经更新了原始问题。这样一来,就 Webhook 而言,它是否被认为是一种有效的方法?
      猜你喜欢
      • 2021-03-18
      • 2020-08-07
      • 2021-12-01
      • 2020-05-29
      • 2021-02-24
      • 2021-06-29
      • 2021-03-05
      • 2018-09-11
      • 2021-09-05
      相关资源
      最近更新 更多