mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-07 00:06:44 +02:00
Only monitor top level single directory + its children if using --single-directory (Issue #709)
* If --single-directory is being used, and we are using --monitor, only set inotify watches on the single directory
This commit is contained in:
parent
7ba59e0b1d
commit
7b4ba2e5d2
|
@ -58,7 +58,17 @@ final class Monitor
|
|||
fd = inotify_init();
|
||||
if (fd < 0) throw new MonitorException("inotify_init failed");
|
||||
if (!buffer) buffer = new void[4096];
|
||||
addRecursive(".");
|
||||
|
||||
// from which point do we start watching for changes?
|
||||
string monitorPath;
|
||||
if (cfg.getValueString("single_directory") != ""){
|
||||
// single directory in use, monitor only this
|
||||
monitorPath = "./" ~ cfg.getValueString("single_directory");
|
||||
} else {
|
||||
// default
|
||||
monitorPath = ".";
|
||||
}
|
||||
addRecursive(monitorPath);
|
||||
}
|
||||
|
||||
void shutdown()
|
||||
|
|
Loading…
Reference in a new issue