Skip to content

Commit 0641d4c

Browse files
authored
fix: Remove obsolete started parameter in UploadRequest (#673)
1 parent cf13c9f commit 0641d4c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

uploadservice/src/main/java/net/gotev/uploadservice/UploadRequest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ abstract class UploadRequest<B : UploadRequest<B>>
2929
constructor(protected val context: Context, protected var serverUrl: String) : Persistable {
3030

3131
private var uploadId = UUID.randomUUID().toString()
32-
private var started: Boolean = false
3332
protected var maxRetries = UploadServiceConfig.retryPolicy.defaultMaxRetries
3433
protected var autoDeleteSuccessfullyUploadedFiles = false
3534
protected var notificationConfig: (context: Context, uploadId: String) -> UploadNotificationConfig =
@@ -65,18 +64,11 @@ constructor(protected val context: Context, protected var serverUrl: String) : P
6564
* generated uploadId
6665
*/
6766
open fun startUpload(): String {
68-
check(!started) {
69-
"You have already called startUpload() on this Upload request instance once and you " +
70-
"cannot call it multiple times. Check your code."
71-
}
72-
7367
check(!UploadService.taskList.contains(uploadTaskParameters.id)) {
7468
"You have tried to perform startUpload() using the same uploadID of an " +
7569
"already running task. You're trying to use the same ID for multiple uploads."
7670
}
7771

78-
started = true
79-
8072
return context.startNewUpload(
8173
params = uploadTaskParameters,
8274
notificationConfig = notificationConfig(context, uploadId)

0 commit comments

Comments
 (0)