ssb-git-repo
Advanced tools
Comparing version 1.8.5 to 1.8.6
@@ -264,2 +264,14 @@ var pull = require('pull-stream') | ||
Repo.prototype._getBlobCachedOnce = function (key, cb) { | ||
// use cached blob if it exists (in case of newly pushed data) | ||
// but don't keep it cached because that wastes memory | ||
if (key in this._blobs) { | ||
var bufs = this._blobs[key] | ||
delete this._blobs[key] | ||
cb(null, pull.values(bufs)) | ||
} else { | ||
this._getBlob(key, cb) | ||
} | ||
} | ||
Repo.prototype._hashLookup = function hashLookup(sha1, cb) { | ||
@@ -451,7 +463,7 @@ if (this.synced || sha1 in this._objects) | ||
Repo.prototype.getPackfile = function (id, cb) { | ||
this._getBlobCached(id, cb) | ||
this._getBlobCachedOnce(id, cb) | ||
} | ||
Repo.prototype.getPackIndex = function (id, cb) { | ||
this._getBlobCached(id, cb) | ||
this._getBlobCachedOnce(id, cb) | ||
} | ||
@@ -458,0 +470,0 @@ |
{ | ||
"name": "ssb-git-repo", | ||
"version": "1.8.5", | ||
"version": "1.8.6", | ||
"description": "git repos in secure-scuttlebutt", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
34593
987