mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #11296 from overleaf/jpa-pdf-caching-ignore-not-found
[clsi] ignore file not found error when unlinking stale chunk GitOrigin-RevId: d7b78f7c2773102d7133f710ad7851542417b472
This commit is contained in:
parent
d5d3fcda47
commit
aa812a066a
1 changed files with 11 additions and 1 deletions
|
@ -352,7 +352,17 @@ class HashFileTracker {
|
|||
}
|
||||
|
||||
await promiseMapWithLimit(10, hashes, async hash => {
|
||||
await fs.promises.unlink(Path.join(this.contentDir, hash))
|
||||
try {
|
||||
await fs.promises.unlink(Path.join(this.contentDir, hash))
|
||||
} catch (err) {
|
||||
if (err?.code === 'ENOENT') {
|
||||
// Ignore already deleted entries. The previous cleanup cycle may have
|
||||
// been killed halfway through the deletion process, or before we
|
||||
// flushed the state to disk.
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
this.hashAge.delete(hash)
|
||||
reclaimedSpace += this.hashSize.get(hash)
|
||||
this.hashSize.delete(hash)
|
||||
|
|
Loading…
Reference in a new issue