mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
feat: remove webp on asset deleted as well (#489)
* fix(server): remove webp file on asset deleted * chore(server): job not fail when file not found
This commit is contained in:
parent
cdb0aa00d8
commit
3aa6ee0320
1 changed files with 10 additions and 1 deletions
|
@ -30,10 +30,19 @@ export class BackgroundTaskProcessor {
|
|||
});
|
||||
|
||||
// TODO: what if there is no asset.resizePath. Should fail the Job?
|
||||
// => panoti report: Job not fail
|
||||
if (asset.resizePath) {
|
||||
fs.unlink(asset.resizePath, (err) => {
|
||||
if (err) {
|
||||
console.log('error deleting ', asset.originalPath);
|
||||
console.log('error deleting ', asset.resizePath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (asset.webpPath) {
|
||||
fs.unlink(asset.webpPath, (err) => {
|
||||
if (err) {
|
||||
console.log('error deleting ', asset.webpPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue