How to shorten Firebase storage download retrying period on Network Error

前端 未结 1 1576
抹茶落季
抹茶落季 2021-01-04 01:34

I have basic working code for downloading file from Firebase storage.

String key = \"gs://.../test.jpg\";
File file = new File(getCacheDir() + File.separato         


        
相关标签:
1条回答
  • 2021-01-04 02:25

    Yes, you can configure the timeout for uploads, downloads, and other operations using the setMaximum{OPERATION}RetryTimeMillis() methods:

    FirebaseStorage storage = FirebaseStorage.getInstance();
    storage.setMaxDownloadRetryTimeMillis(60000);  // wait 1 min for downloads
    storage.setMaxOperationRetryTimeMillis(10000);  // wait 10s for normal ops
    storage.setMaxUploadRetryTimeMillis(120000);  // wait 2 mins for uploads
    

    See the reference docs for more,

    0 讨论(0)
提交回复
热议问题