File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,10 @@ class Task extends ObservableBase {
198198 if ( autoDeleteAfterUpload ) {
199199 request . setAutoDeleteFilesAfterSuccessfulUpload ( true ) ;
200200 }
201+ const maxRetryCount = typeof options . androidMaxRetries === "number" ? options . androidMaxRetries : undefined ;
202+ if ( maxRetryCount ) {
203+ request . setMaxRetries ( maxRetryCount ) ;
204+ }
201205
202206 const headers = options . headers ;
203207 if ( headers ) {
@@ -269,6 +273,14 @@ class Task extends ObservableBase {
269273 uploadNotificationConfig . setTitleForAllStatuses ( notificationTitle ) ;
270274 request . setNotificationConfig ( uploadNotificationConfig ) ;
271275 }
276+ const autoDeleteAfterUpload = typeof options . androidAutoDeleteAfterUpload === "boolean" ? options . androidAutoDeleteAfterUpload : false ;
277+ if ( autoDeleteAfterUpload ) {
278+ request . setAutoDeleteFilesAfterSuccessfulUpload ( true ) ;
279+ }
280+ const maxRetryCount = typeof options . androidMaxRetries === "number" ? options . androidMaxRetries : undefined ;
281+ if ( maxRetryCount ) {
282+ request . setMaxRetries ( maxRetryCount ) ;
283+ }
272284
273285 const headers = options . headers ;
274286 if ( headers ) {
Original file line number Diff line number Diff line change @@ -185,4 +185,10 @@ export interface Request {
185185 * Use this to set if files should be deleted automatically after upload
186186 */
187187 androidAutoDeleteAfterUpload ?: boolean ;
188+
189+ /*
190+ * Use this to set the maximum retry count. The default retry count is 0
191+ * https://github.com/gotev/android-upload-service/wiki/Recipes#backoff
192+ */
193+ androidMaxRetries ?: number ;
188194}
You can’t perform that action at this time.
0 commit comments