Skip to content

Commit b20a9f3

Browse files
committed
feat: add verbosity to the automatic uploads worker
1 parent c9139c8 commit b20a9f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

owncloudApp/src/main/java/com/owncloud/android/workers/AutomaticUploadsWorker.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ class AutomaticUploadsWorker(
133133
val currentTimestamp = System.currentTimeMillis()
134134
updateTimestamp(folderBackUpConfiguration, syncType, currentTimestamp)
135135

136+
Timber.i("Timestamp updated correctly. Current timestamp: ${Date(currentTimestamp)}")
137+
136138
val localPicturesDocumentFiles: List<DocumentFile> = getFilesReadyToUpload(
137139
syncType = syncType,
138140
sourcePath = folderBackUpConfiguration.sourcePath,
139141
lastSyncTimestamp = folderBackUpConfiguration.lastSyncTimestamp,
140142
currentTimestamp = currentTimestamp,
141143
)
142144

145+
Timber.i("The search for files to upload has finished")
146+
143147
showNotification(syncType, localPicturesDocumentFiles.size)
144148

145149
for (documentFile in localPicturesDocumentFiles) {
@@ -165,6 +169,8 @@ class AutomaticUploadsWorker(
165169
chargingOnly = folderBackUpConfiguration.chargingOnly
166170
)
167171
}
172+
173+
Timber.i("Folder synchronization has finished")
168174
}
169175

170176
private fun showNotification(
@@ -242,9 +248,17 @@ class AutomaticUploadsWorker(
242248
currentTimestamp: Long,
243249
): List<DocumentFile> {
244250
val sourceUri: Uri = sourcePath.toUri()
251+
252+
Timber.i ("Source uri is: $sourceUri")
253+
245254
val documentTree = DocumentFile.fromTreeUri(applicationContext, sourceUri)
255+
256+
Timber.i ("Document tree is: $documentTree")
257+
246258
val arrayOfLocalFiles = documentTree?.listFiles() ?: arrayOf()
247259

260+
Timber.i("The search of local files has finished. Now, all files are going to be filtered")
261+
248262
val filteredList: List<DocumentFile> = arrayOfLocalFiles
249263
.sortedBy { it.lastModified() }
250264
.filter { it.lastModified() >= lastSyncTimestamp }

0 commit comments

Comments
 (0)