Skip to content

Commit cae7906

Browse files
Mark some archive logs as keep longer.
1 parent 7ea8cc6 commit cae7906

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentBackfillJob.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ class ArchiveAttachmentBackfillJob private constructor(parameters: Parameters) :
5050
ArchiveUploadProgress.onAttachmentSectionStarted(SignalDatabase.attachments.getPendingArchiveUploadBytes())
5151

5252
if (!isCanceled) {
53-
Log.i(TAG, "Adding ${jobs.size} jobs to backfill attachments.")
53+
Log.i(TAG, "Adding ${jobs.size} jobs to backfill attachments.", true)
5454
AppDependencies.jobManager.addAll(jobs)
5555
} else {
56-
Log.w(TAG, "Job was canceled. Not enqueuing backfill.")
56+
Log.w(TAG, "Job was canceled. Not enqueuing backfill.", true)
5757
}
5858

5959
return Result.success()

app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveAttachmentReconciliationJob.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class ArchiveAttachmentReconciliationJob private constructor(
9595
}
9696

9797
if (SignalStore.backup.lastAttachmentReconciliationTime < 0) {
98-
Log.w(TAG, "First ever time we're attempting a reconciliation. Setting the last sync time to now, so we'll run at the proper interval. Skipping this iteration.")
98+
Log.w(TAG, "First ever time we're attempting a reconciliation. Setting the last sync time to now, so we'll run at the proper interval. Skipping this iteration.", true)
9999
SignalStore.backup.lastAttachmentReconciliationTime = System.currentTimeMillis()
100100
return Result.success()
101101
}
@@ -127,7 +127,7 @@ class ArchiveAttachmentReconciliationJob private constructor(
127127
private fun syncDataFromCdn(snapshotVersion: Long): Result? {
128128
do {
129129
if (isCanceled) {
130-
Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.")
130+
Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.", true)
131131
return Result.failure()
132132
}
133133

@@ -145,11 +145,11 @@ class ArchiveAttachmentReconciliationJob private constructor(
145145
} while (serverCursor != null)
146146

147147
if (isCanceled) {
148-
Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.")
148+
Log.w(TAG, "Job cancelled while syncing archived attachments from the CDN.", true)
149149
return Result.failure()
150150
}
151151

152-
Log.d(TAG, "BEFORE:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString())
152+
Log.d(TAG, "BEFORE:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString(), true)
153153

154154
val mediaObjectsThatMayNeedReUpload = SignalDatabase.backupMediaSnapshots.getMediaObjectsLastSeenOnCdnBeforeSnapshotVersion(snapshotVersion)
155155
val mayNeedReUploadCount = mediaObjectsThatMayNeedReUpload.count
@@ -200,10 +200,10 @@ class ArchiveAttachmentReconciliationJob private constructor(
200200
Log.i(TAG, "None of the $mayNeedReUploadCount CDN mismatches were bookkeeping errors.", true)
201201
}
202202

203-
Log.d(TAG, "AFTER:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString())
203+
Log.d(TAG, "AFTER:\n" + SignalDatabase.attachments.debugGetAttachmentStats().prettyString(), true)
204204

205205
if (internalUser && mediaIdsThatNeedUpload.isNotEmpty()) {
206-
Log.w(TAG, "Starting internal-only lookup of matching attachments. May take a while!")
206+
Log.w(TAG, "Starting internal-only lookup of matching attachments. May take a while!", true)
207207

208208
val matchingAttachments = SignalDatabase.attachments.debugGetAttachmentsForMediaIds(mediaIdsThatNeedUpload, limit = 10_000)
209209
Log.w(TAG, "Found ${matchingAttachments.size} out of the ${mediaIdsThatNeedUpload.size} attachments we looked up (capped lookups to 10k).", true)
@@ -212,9 +212,9 @@ class ArchiveAttachmentReconciliationJob private constructor(
212212
val (attachment, isThumbnail) = pair
213213
if (isThumbnail) {
214214
val thumbnailTransferState = SignalDatabase.attachments.getArchiveThumbnailTransferState(attachment.attachmentId)
215-
Log.w(TAG, "[Thumbnail] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, archiveThumbnailTransferState=$thumbnailTransferState, hasData=${attachment.hasData}")
215+
Log.w(TAG, "[Thumbnail] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, archiveThumbnailTransferState=$thumbnailTransferState, hasData=${attachment.hasData}", true)
216216
} else {
217-
Log.w(TAG, "[Fullsize] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, hasData=${attachment.hasData}")
217+
Log.w(TAG, "[Fullsize] Needed Upload: attachmentId=${attachment.attachmentId}, messageId=${attachment.mmsId}, contentType=${attachment.contentType}, quote=${attachment.quote}, transferState=${attachment.transferState}, archiveTransferState=${attachment.archiveTransferState}, hasData=${attachment.hasData}", true)
218218
}
219219
}
220220
}
@@ -234,7 +234,7 @@ class ArchiveAttachmentReconciliationJob private constructor(
234234
}
235235
}
236236
} else {
237-
Log.d(TAG, "No attachments need to be repaired.")
237+
Log.d(TAG, "No attachments need to be repaired.", true)
238238
}
239239

240240
SignalStore.backup.remoteStorageGarbageCollectionPending = false

app/src/main/java/org/thoughtcrime/securesms/jobs/ArchiveThumbnailBackfillJob.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class ArchiveThumbnailBackfillJob private constructor(parameters: Parameters) :
4545
.map { attachmentId -> ArchiveThumbnailUploadJob(attachmentId) }
4646

4747
if (!isCanceled) {
48-
Log.i(TAG, "Adding ${jobs.size} jobs to backfill thumbnails.")
48+
Log.i(TAG, "Adding ${jobs.size} jobs to backfill thumbnails.", true)
4949
AppDependencies.jobManager.addAll(jobs)
5050
} else {
51-
Log.w(TAG, "Job was canceled. Not enqueuing backfill.")
51+
Log.w(TAG, "Job was canceled. Not enqueuing backfill.", true)
5252
}
5353

5454
return Result.success()

0 commit comments

Comments
 (0)