Fix deprecation warning about no callback to fs.unlink

This commit is contained in:
Calvin Montgomery 2017-12-06 22:16:25 -08:00
parent 39587a8448
commit 4e8c97bfb5
1 changed files with 9 additions and 1 deletions

View File

@ -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
);
}
});
} }
}); });
}); });