Backfill improvements
This commit is contained in:
@@ -364,16 +364,6 @@ async function runDownloadAttachmentJob({
|
||||
try {
|
||||
log.info(`${logId}: Starting job`);
|
||||
|
||||
if (
|
||||
job.source !== AttachmentDownloadSource.BACKFILL &&
|
||||
isPermanentlyUndownloadableWithoutBackfill(job.attachment)
|
||||
) {
|
||||
// We should only get to here only if
|
||||
throw new AttachmentPermanentlyUndownloadableError(
|
||||
'Not downloadable without backfill'
|
||||
);
|
||||
}
|
||||
|
||||
const result = await runDownloadAttachmentJobInner({
|
||||
job,
|
||||
abortSignal: options.abortSignal,
|
||||
@@ -576,6 +566,16 @@ export async function runDownloadAttachmentJobInner({
|
||||
{ type: attachmentType }
|
||||
);
|
||||
|
||||
if (
|
||||
job.source !== AttachmentDownloadSource.BACKFILL &&
|
||||
isPermanentlyUndownloadableWithoutBackfill(job.attachment)
|
||||
) {
|
||||
// We should only get to here only if
|
||||
throw new AttachmentPermanentlyUndownloadableError(
|
||||
'Not downloadable without backfill'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const { downloadPath } = attachment;
|
||||
let totalDownloaded = 0;
|
||||
|
@@ -100,7 +100,7 @@ export class AttachmentBackfill {
|
||||
timestamp,
|
||||
response,
|
||||
}: AttachmentBackfillResponseSyncEvent): Promise<void> {
|
||||
const logId = `onAttachmentBackfillResponseSync(${timestamp})`;
|
||||
let logId = `onAttachmentBackfillResponseSync(${timestamp})`;
|
||||
if (!isBackfillEnabled()) {
|
||||
log.info(`${logId}: disabled`);
|
||||
return;
|
||||
@@ -129,6 +129,7 @@ export class AttachmentBackfill {
|
||||
}
|
||||
|
||||
const message = window.MessageCache.register(new MessageModel(attributes));
|
||||
logId += `(${message.get('sent_at')})`;
|
||||
|
||||
const timer = this.#pendingRequests.get(message.id);
|
||||
if (timer != null) {
|
||||
|
Reference in New Issue
Block a user