Skip to content

Commit

Permalink
create stream during the try to store. otherwise getting stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
NickOvt committed Sep 13, 2024
1 parent 2d8b782 commit e3afdec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/attachments/gridstore-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const FEATURE_DECODE_ATTACHMENTS = true;
const ORPHANED_ATTACHMENTS_DELAY = 24 * 3600 * 1000;
const MAX_ORPHANED_ATTACHMENTS = 1000;

let fileHashCalculator = new FileHashCalculatorStream();

class GridstoreStorage {
constructor(options) {
this.bucketName = (options.options && options.options.bucket) || 'attachments';
Expand Down Expand Up @@ -191,6 +189,8 @@ class GridstoreStorage {
return;
}

let fileHashCalculator = new FileHashCalculatorStream();

this.gridfs.collection(this.bucketName + '.files').findOneAndUpdate(
{
_id: hash
Expand Down

0 comments on commit e3afdec

Please sign in to comment.