Handle failures in chunk uploads (#3916)

* Handle failures in chunk uploads

* Fix failures

* Upload fixed

* Handle multiple file upload

* Increase request timeout
This commit is contained in:
Vivek Maskara 2020-10-24 23:56:48 -07:00 committed by GitHub
parent 0d5fa048a5
commit 6c55525a43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 69 additions and 38 deletions

View file

@ -6,20 +6,20 @@ import fr.free.nrw.commons.upload.UploadResult
data class ChunkInfo(
val uploadResult: UploadResult,
val lastChunkIndex: Int,
var isLastChunkUploaded: Boolean
val indexOfNextChunkToUpload: Int,
val totalChunks: Int
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readParcelable(UploadResult::class.java.classLoader),
parcel.readInt(),
parcel.readByte() != 0.toByte()
parcel.readInt()
) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeParcelable(uploadResult, flags)
parcel.writeInt(lastChunkIndex)
parcel.writeByte(if (isLastChunkUploaded) 1 else 0)
parcel.writeInt(indexOfNextChunkToUpload)
parcel.writeInt(totalChunks)
}
override fun describeContents(): Int {