mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-09 06:00:46 +01:00
fix: handle ENOENT on file deletion, closes #10645
This commit is contained in:
@@ -107,6 +107,11 @@ file.delete = async function (path) {
|
||||
try {
|
||||
await fs.promises.unlink(path);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
winston.verbose(`[file] Attempted to delete non-existent file: ${path}`);
|
||||
return;
|
||||
}
|
||||
|
||||
winston.warn(err);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,9 +135,10 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-4">
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="orphanExpiryDays">[[admin/settings/uploads:orphanExpiryDays]]</label>
|
||||
<input id="orphanExpiryDays" type="number" min="0" placeholder="0 to disable" class="form-control" data-field="orphanExpiryDays" />
|
||||
<input id="orphanExpiryDays" type="number" min="0" placeholder="0" class="form-control" data-field="orphanExpiryDays" />
|
||||
<p class="help-block">[[admin/settings/uploads:orphanExpiryDays-help]]</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user