Skip to content

Commit

Permalink
Make code better readable and add early exit if no folder is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Apr 9, 2024
1 parent ac9902f commit cf8199e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/com/nextcloud/client/jobs/FilesSyncWork.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ class FilesSyncWork(
// or sync worker already running and no changed files to be processed
val alreadyRunning = backgroundJobManager.bothFilesSyncJobsRunning()
if (alreadyRunning && changedFiles.isNullOrEmpty()) {
Log_OC.d(TAG, "Kill Sync Worker since another instance of the worker seems to be running already!")
Log_OC.d(TAG, "FILESYNC Kill Sync Worker since another instance of the worker seems to be running already!")
return true
}

if (! syncedFolderProvider.syncedFolders.any { it.isEnabled }){
Log_OC.d(TAG, "FILESYNC Kill Sync Worker since no sync folder is enabled!")
return true
}

Expand Down

0 comments on commit cf8199e

Please sign in to comment.