mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-20 06:36:40 +02:00
* Handle a directory in the sync_dir when no permission to access * Log the error during sync rather that only in verbose mode
This commit is contained in:
parent
56f63439e8
commit
bbf35f12ea
|
@ -106,10 +106,16 @@ final class Monitor
|
||||||
}
|
}
|
||||||
|
|
||||||
add(dirname);
|
add(dirname);
|
||||||
foreach(DirEntry entry; dirEntries(dirname, SpanMode.shallow, false)) {
|
try {
|
||||||
if (entry.isDir) {
|
auto pathList = dirEntries(dirname, SpanMode.shallow, false);
|
||||||
addRecursive(entry.name);
|
foreach(DirEntry entry; pathList) {
|
||||||
|
if (entry.isDir) {
|
||||||
|
addRecursive(entry.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (std.file.FileException e) {
|
||||||
|
log.vdebug("ERROR: ", e.msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +130,13 @@ final class Monitor
|
||||||
log.log("To change the current max number of watches to 524288 run:");
|
log.log("To change the current max number of watches to 524288 run:");
|
||||||
log.log("sudo sysctl fs.inotify.max_user_watches=524288");
|
log.log("sudo sysctl fs.inotify.max_user_watches=524288");
|
||||||
}
|
}
|
||||||
throw new MonitorException("inotify_add_watch failed");
|
if (errno() == 13) {
|
||||||
|
log.vlog("WARNING: inotify_add_watch failed - permission denied: ", pathname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Flag any other errors
|
||||||
|
log.error("ERROR: inotify_add_watch failed: ", pathname);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
wdToDirName[wd] = buildNormalizedPath(pathname) ~ "/";
|
wdToDirName[wd] = buildNormalizedPath(pathname) ~ "/";
|
||||||
log.vlog("Monitor directory: ", pathname);
|
log.vlog("Monitor directory: ", pathname);
|
||||||
|
|
13
src/sync.d
13
src/sync.d
|
@ -1748,9 +1748,16 @@ final class SyncEngine
|
||||||
log.vlog("Directory disappeared during upload: ", path);
|
log.vlog("Directory disappeared during upload: ", path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto entries = dirEntries(path, SpanMode.shallow, false);
|
|
||||||
foreach (DirEntry entry; entries) {
|
// Try and access the directory and any path below
|
||||||
uploadNewItems(entry.name);
|
try {
|
||||||
|
auto entries = dirEntries(path, SpanMode.shallow, false);
|
||||||
|
foreach (DirEntry entry; entries) {
|
||||||
|
uploadNewItems(entry.name);
|
||||||
|
}
|
||||||
|
} catch (std.file.FileException e) {
|
||||||
|
log.error("ERROR: ", e.msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This item is a file
|
// This item is a file
|
||||||
|
|
Loading…
Reference in a new issue