[英]How does Firebase update one callable function when you modify a code used by many other functions
我發現自己經常遇到這種情況,而且我找不到關於 go 的正確方法的明確解釋。
假設您有 (n) 個可調用函數,(m) 個觸發器,它們都使用您更新的一段內部代碼。 您應該部署使用該代碼的所有功能,還是更新其中一個會傳播到其他功能?
PS:當我部署整個項目時,它通常會失敗。 所以現在我只單獨部署功能似乎效果更好。 但是一個一個的部署功能是非常繁瑣的。 即使當我部署函數列表時它也會失敗,即: firebase deploy --only functions:function1,function2
不熟悉你的問題的答案,我在 typescript 進行了快速測試。
exports.testing1 = functions.https.onCall(test1);
exports.testing2 = functions.https.onCall(test2);
export async function getString(): Promise<(String)>{
return("Hello test");
//return "Hello World";
}
export async function test1(){
//console.log("New test1");
console.log(await getString());
}
export async function test2(){
console.log(await getString());
}
我添加了這些功能,然后在 helper function 中關閉了 hello world 的 return hello test,並在注釋掉的 New test 1 print 中添加。 然后我跑了
firebase deploy --only functions:testing1
然后再次調用這兩個函數。 testing1更新到新的output,testing2沒有。
我認為每個函數都可以完全編譯,並在它們自己的運行時環境中運行,這對於穩定性和可擴展性來說是有意義的。 因此,我們可以得出結論,更新 helper function 然后不更新整個項目可能會導致某些功能使用舊 helper function。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.