Filesystem: Temporarily cache inode data until storage is chunked properly
This commit is contained in:
parent
fe5a1f5322
commit
eb93fa5db7
1 changed files with 7 additions and 1 deletions
|
|
@ -1089,7 +1089,13 @@ FS.prototype.get_data = async function(idx) // jshint ignore:line
|
|||
dbg_assert(inode, `Filesystem get_data: idx ${idx} does not point to an inode`);
|
||||
|
||||
if(this.inodedata[idx]) return this.inodedata[idx];
|
||||
if(inode.sha256sum && this.storage) return await this.storage.get(inode.sha256sum); // jshint ignore:line
|
||||
if(inode.sha256sum && this.storage)
|
||||
{
|
||||
const data = await this.storage.get(inode.sha256sum); // jshint ignore:line
|
||||
// XXX: Temporary cache until storage can properly chunk
|
||||
this.inodedata[idx] = data;
|
||||
return data;
|
||||
}
|
||||
return null;
|
||||
}; // jshint ignore:line
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue