Skip to content

Commit

Permalink
fix: revert to allow 3 attachments download at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Aug 10, 2022
1 parent 415fd2f commit c08f761
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ts/session/utils/AttachmentsDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { initializeAttachmentLogic, processNewAttachment } from '../../types/Mes
import { getAttachmentMetadata } from '../../types/message/initializeAttachmentMetadata';

// this cause issues if we increment that value to > 1.
const MAX_ATTACHMENT_JOB_PARALLELISM = 1;
const MAX_ATTACHMENT_JOB_PARALLELISM = 3;

const TICK_INTERVAL = Constants.DURATION.MINUTES;
// tslint:disable: function-name
Expand Down Expand Up @@ -231,7 +231,11 @@ async function _runJob(job: any) {
);
found = await Data.getMessageById(messageId);

_addAttachmentToMessage(found, _markAttachmentAsError(attachment), { type, index });
try {
_addAttachmentToMessage(found, _markAttachmentAsError(attachment), { type, index });
} catch (e) {
// just swallow any exceptions here, as it would be an unhandled one
}
await _finishJob(found || null, id);

return;
Expand Down

0 comments on commit c08f761

Please sign in to comment.