1
0
Fork 0

[client] Add debug method to clear the requested chunks from the chunk cache.

This commit is contained in:
Starbeamrainbowlabs 2017-12-15 20:05:53 +00:00
parent ea4a8b9b15
commit 9fa7a04d47
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,14 @@ class ChunkCache
return lineFragments;
}
clearRequestedChunks()
{
for(let [chunkRefStr, chunk] of this.cache.entries()) {
if(!(chunk instanceof Chunk))
this.cache.delete(chunkRefStr);
}
}
/**
* Adds the given chunk to the chunk cache.
* @param {Chunk} chunkData The chunk to add to the cache.