mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-09 09:16:42 +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);
|
||||
foreach(DirEntry entry; dirEntries(dirname, SpanMode.shallow, false)) {
|
||||
if (entry.isDir) {
|
||||
addRecursive(entry.name);
|
||||
try {
|
||||
auto pathList = dirEntries(dirname, SpanMode.shallow, false);
|
||||
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("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) ~ "/";
|
||||
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);
|
||||
return;
|
||||
}
|
||||
auto entries = dirEntries(path, SpanMode.shallow, false);
|
||||
foreach (DirEntry entry; entries) {
|
||||
uploadNewItems(entry.name);
|
||||
|
||||
// Try and access the directory and any path below
|
||||
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 {
|
||||
// This item is a file
|
||||
|
|
Loading…
Reference in a new issue