Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
don't add the same shard hash to a file staging frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Hall committed Jun 24, 2016
1 parent a60b986 commit 47be90f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/storage/models/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ Frame.methods.addShard = function(shard, callback) {
return callback(err);
}

for (let s = 0; s < this.shards.length; s++) {
if (this.shards[s].hash === shard.hash) {
return callback(null);
}
}

this.shards.push(shard);
callback(null);
};
Expand Down

0 comments on commit 47be90f

Please sign in to comment.