Skip to content

Commit

Permalink
Merge pull request #2411 from oxen-io/clearnet
Browse files Browse the repository at this point in the history
fix: revert to allow 3 attachments download at a time
  • Loading branch information
Bilb authored Aug 10, 2022
2 parents 481e572 + c08f761 commit 45889ad
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 45889ad

Please sign in to comment.