mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 01:31:27 +03:00
Fixed issue where youtube-dl autoupdates broke if checkExistsWithTimeout failed the first time
This commit is contained in:
@@ -837,7 +837,7 @@ async function checkExistsWithTimeout(filePath, timeout) {
|
|||||||
fs.access(filePath, fs.constants.R_OK, function (err) {
|
fs.access(filePath, fs.constants.R_OK, function (err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
watcher.close();
|
if (watcher) watcher.close();
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -847,7 +847,7 @@ async function checkExistsWithTimeout(filePath, timeout) {
|
|||||||
var watcher = fs.watch(dir, function (eventType, filename) {
|
var watcher = fs.watch(dir, function (eventType, filename) {
|
||||||
if (eventType === 'rename' && filename === basename) {
|
if (eventType === 'rename' && filename === basename) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
watcher.close();
|
if (watcher) watcher.close();
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user