Skip to content

Commit

Permalink
Rename function and remove pending uploads variable
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Dec 29, 2023
1 parent eb163d8 commit 3fcb2fb
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class FileUploadHelper {
companion object {
private val TAG = FileUploadWorker::class.java.simpleName

// TODO is needed with worker?
// val pendingUploads = IndexedForest<UploadFileOperation>()
val mBoundListeners = HashMap<String, OnDatatransferProgressListener>()

fun buildRemoteName(accountName: String, remotePath: String): String {
Expand Down Expand Up @@ -100,13 +98,13 @@ class FileUploadHelper {
// since the operation will not get to be run by FileUploader#uploadFile
uploadsStorageManager.removeUpload(accountName, remotePath)

restartUploadJob(user)
cancelAndRestartUploadJob(user)
} catch (e: NoSuchElementException) {
Log_OC.e(TAG, "Error cancelling current upload because user does not exist!")
}
}

private fun restartUploadJob(user: User) {
private fun cancelAndRestartUploadJob(user: User) {
backgroundJobManager.run {
cancelFilesUploadJob(user)
startFilesUploadJob(user)
Expand Down Expand Up @@ -180,9 +178,8 @@ class FileUploadHelper {
}

fun cancel(accountName: String) {
// pendingUploads.remove(accountName)
uploadsStorageManager.removeUploads(accountName)
restartUploadJob(accountManager.getUser(accountName).get())
cancelAndRestartUploadJob(accountManager.getUser(accountName).get())
}

fun addUploadTransferProgressListener(
Expand Down

0 comments on commit 3fcb2fb

Please sign in to comment.