【发布时间】:2019-02-24 11:41:26
【问题描述】:
所以基本上我有一个火力云 onWrite 函数,执行时调用客户端提醒他打开他的仪表板。我正在使用nexmo api。无论如何,我试图这样做是为了让函数在执行之前等待一段时间,因为值可能会改变,如果它改变(不要打电话给客户端)如果没有改变打电话给他
像这样:-
// When new order is placed call the function
// Wait for 10 min if there is any change
(if there is no change to that value) {
call();
} else {
if the value changed during that time stop the function
return;
}
我已经尝试过 setTimeout(),但它在初始值上执行,我希望它在 10 分钟后在最终值上执行。
【问题讨论】:
标签: javascript function firebase-realtime-database google-cloud-functions vonage