MCPcopy Index your code
hub / github.com/ollm/OpenComic / deleteInCacheSha

Function deleteInCacheSha

scripts/cache.js:602–620  ·  view source on GitHub ↗
(sha, returnFileSize = false)

Source from the content-addressed store, hash-verified

600
601
602function deleteInCacheSha(sha, returnFileSize = false)
603{
604 let cachePath = p.join(cacheFolder, sha+'.jpg');
605
606 if(data[sha])
607 delete data[sha];
608
609 let fileSize = 0;
610
611 if(fs.existsSync(cachePath))
612 {
613 if(returnFileSize)
614 fileSize = fs.statSync(cachePath).size;
615
616 fs.unlinkSync(cachePath);
617 }
618
619 return fileSize;
620}
621
622function purge()
623{

Callers 1

purgeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected