简体   繁体   English

Firebase 存储(文件)备份

[英]Firebase storage (files) backup

We have a scheduled function that processes a firebase backup.我们有一个预定的 function 处理一个 firebase 备份。

For Firestore DB, we use a built-in method - https://firebase.google.com/docs/firestore/solutions/schedule-export对于 Firestore DB,我们使用内置方法 - https://firebase.google.com/docs/firestore/solutions/schedule-export

However, we also need to back up user files that are placed in the storage.但是,我们还需要备份放在存储中的用户文件。 I did not find a good solution for files backup, so I ended up using of bucket.copy method - it will copy files one by one and put them into another storage.我没有找到一个很好的文件备份解决方案,所以我最终使用bucket.copy方法 - 它会一个一个地复制文件并将它们放入另一个存储中。

That worked fine for some period, but now the function experiences a timeout error (as we have a lot of files already) - Function execution took 540026 ms, finished with status: 'timeout' .这在一段时间内运行良好,但现在 function 出现超时错误(因为我们已经有很多文件)- Function execution took 540026 ms, finished with status: 'timeout'

As the amount of files is growing every day, I am not sure how to fix the timeout issue.由于文件数量每天都在增长,我不确定如何解决timeout问题。 Could you please advise?您能否提一些建议?

Would you recommend using another way?你会推荐使用另一种方式吗? If so, please specify如果有,请说明

Increase your memory and add parameter in functions增加你的 memory 并在函数中添加参数

Try below code试试下面的代码

const runtimeOpts = {
  timeoutSeconds: 300,
  memory: '1GB'
}

exports.getMessages = functions.runWith(runtimeOpts).https.onCall((data, context) => {
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Storage Transfer Service 备份 Google Firebase 存储 - Storage Transfer Service To backup Google Firebase Storage 上传文件到 firebase 存储不工作 - upload files to firebase storage not working Firebase 存储:我应该删除 firebase 存储中的工件文件吗? - Firebase storage: should I delete artifacts files in my firebase storage? 获取firebase存储中多个文件的下载地址 - Get the download URLs of multiple files in firebase storage 将文件上传到 firebase 存储和云 firebase 时创建 2 个不同的 url - 2 different urls created while uploading files to firebase storage and cloud firebase 上传文件到firebase存储Flutter后无法获取下载链接 - Cannot get the download link after uploading files to firebase storage Flutter 将文件上传到 android 的 firebase 存储中的用户特定目录? - Uploading files to user specific directories in firebase storage for android? Firebase 云存储 - Unity - PutStreamAsync memory 大文件崩溃 - Firebase Cloud Storage - Unity - PutStreamAsync memory crash with large files 将文件从 Firebase 云函数上传到云存储 - Uploading files from Firebase Cloud Functions to Cloud Storage 如何从 firebase 存储中存储的文件中获取 URL? - How to get URL from files stored in firebase Storage?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM