mirror of https://github.com/calzoneman/sync.git
Fix deprecation warning about no callback to fs.unlink
This commit is contained in:
parent
39587a8448
commit
4e8c97bfb5
|
@ -167,7 +167,15 @@ function clearOldSubtitles() {
|
||||||
|
|
||||||
if (stats.mtime.getTime() < Date.now() - ONE_DAY) {
|
if (stats.mtime.getTime() < Date.now() - ONE_DAY) {
|
||||||
LOGGER.info('Deleting old subtitle file: ' + file);
|
LOGGER.info('Deleting old subtitle file: ' + file);
|
||||||
fs.unlink(path.join(subtitleDir, file));
|
fs.unlink(path.join(subtitleDir, file), error => {
|
||||||
|
if (error) {
|
||||||
|
LOGGER.error(
|
||||||
|
'Failed to remove file %s: %s',
|
||||||
|
file,
|
||||||
|
error.stack
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue