Skip to content

Commit

Permalink
fix spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Jan 29, 2024
1 parent 2723d4a commit e779777
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import androidx.work.PeriodicWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import androidx.work.workDataOf
import com.google.common.util.concurrent.ListenableFuture
import com.nextcloud.client.account.User
import com.nextcloud.client.core.Clock
import com.nextcloud.client.di.Injectable
Expand All @@ -45,11 +44,9 @@ import com.nextcloud.client.preferences.AppPreferences
import com.nextcloud.utils.extensions.isWorkRunning
import com.nextcloud.utils.extensions.isWorkScheduled
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.operations.DownloadType
import java.util.Date
import java.util.UUID
import java.util.concurrent.ExecutionException
import java.util.concurrent.TimeUnit
import kotlin.reflect.KClass

Expand Down Expand Up @@ -421,7 +418,6 @@ internal class BackgroundJobManagerImpl(
}

override fun bothFilesSyncJobsRunning(): Boolean {

return workManager.isWorkRunning(JOB_PERIODIC_FILES_SYNC) &&
workManager.isWorkRunning(JOB_IMMEDIATE_FILES_SYNC)
}
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/com/nextcloud/client/jobs/FilesSyncWork.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ class FilesSyncWork(

@Suppress("MagicNumber")
override suspend fun doWork(): Result {
if (backgroundJobManager.bothFilesSyncJobsRunning()){
Log_OC.d(TAG,"Kill Sync Worker since another instance of the worker seems to be running already!")
if (backgroundJobManager.bothFilesSyncJobsRunning()) {
Log_OC.d(TAG, "Kill Sync Worker since another instance of the worker seems to be running already!")
return Result.success()
}
backgroundJobManager.logStartOfWorker(BackgroundJobManagerImpl.formatClassTag(this::class))
setForeground(createForegroundInfo(0))



val overridePowerSaving = inputData.getBoolean(OVERRIDE_POWER_SAVING, false)
// If we are in power save mode, better to postpone upload
if (powerManagementService.isPowerSavingEnabled && !overridePowerSaving) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ fun WorkManager.isWorkRunning(tag: String): Boolean {

return running
}


0 comments on commit e779777

Please sign in to comment.