Firebase Cloud Functions——同时服务多个用户

Firebase Cloud Functions - serving multiple users at once

我正在创建一个 Firebase 函数,用于从用户指定的网页中抓取图像。我当前的实现使用 axios 下载图像并使用 fs 将它们保存到本地函数项目目录。我只能在本地测试该功能,所以我不确定它在生产中如何工作。

我把文件保存在本地,如果多个用户在不同的网页同时调用该函数会怎样?文件会互相覆盖吗?

谢谢

Since I have the files saved locally, what happens if multiple users call the function at the same time with different webpages? Will the files overwrite each other?

并行调用将在不同的实例上 运行。 Cloud Functions 会根据需要自动创建尽可能多的实例,并在负载减少时缩减。