Update 'min_notif_changes' to 'min_notify_changes' (#467)

* Update 'min_notif_changes' to 'min_notify_changes'
This commit is contained in:
abraunegg 2019-04-15 06:28:32 +10:00 committed by GitHub
parent 521cf33001
commit 25d2f7284f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View file

@ -327,7 +327,7 @@ Config option 'skip_file' = ~*|.~*|*.tmp
Config option 'skip_dotfiles' = false Config option 'skip_dotfiles' = false
Config option 'skip_symlinks' = false Config option 'skip_symlinks' = false
Config option 'monitor_interval' = 45 Config option 'monitor_interval' = 45
Config option 'min_notif_changes' = 5 Config option 'min_notify_changes' = 5
Config option 'log_dir' = /var/log/onedrive/ Config option 'log_dir' = /var/log/onedrive/
Selective sync configured = false Selective sync configured = false
``` ```
@ -521,8 +521,8 @@ Example: `monitor_interval = "300"`
The monitor interval is defined as the wait time 'between' sync's when running in monitor mode. By default without configuration, the monitor_interval is set to 45 seconds. Setting this value to 300 will run the sync process every 5 minutes. The monitor interval is defined as the wait time 'between' sync's when running in monitor mode. By default without configuration, the monitor_interval is set to 45 seconds. Setting this value to 300 will run the sync process every 5 minutes.
### min_notif_changes ### min_notify_changes
Example: `min_notif_changes = "5"` Example: `min_notify_changes = "5"`
This option defines the minimum number of pending incoming changes necessary to trigger a desktop notification. This allows controlling the frequency of notifications. This option defines the minimum number of pending incoming changes necessary to trigger a desktop notification. This allows controlling the frequency of notifications.

2
config
View file

@ -25,6 +25,6 @@
# skip_dotfiles = "false" # skip_dotfiles = "false"
# dry_run = "false" # dry_run = "false"
# monitor_interval = "45" # monitor_interval = "45"
# min_notif_changes = "5" # min_notify_changes = "5"
# monitor_log_frequency = "5" # monitor_log_frequency = "5"
# monitor_fullscan_frequency = "10" # monitor_fullscan_frequency = "10"

View file

@ -98,7 +98,7 @@ Configuration file key: \fBlog_dir\fP (default: \fB/var/log/onedrive/\fP)
the minimum number of pending incoming changes necessary to trigger the minimum number of pending incoming changes necessary to trigger
a desktop notification a desktop notification
.br .br
Configuration file key: \fBmin_notif_changes\fP (default: \fB5\fP) Configuration file key: \fBmin_notify_changes\fP (default: \fB5\fP)
.TP .TP
\fB\-m \-\-monitor\fP \fB\-m \-\-monitor\fP
Keep monitoring for local and remote changes Keep monitoring for local and remote changes

View file

@ -48,7 +48,7 @@ final class Config
boolValues["dry_run"] = false; boolValues["dry_run"] = false;
longValues["verbose"] = log.verbose; // might be initialized by the first getopt call! longValues["verbose"] = log.verbose; // might be initialized by the first getopt call!
longValues["monitor_interval"] = 45, longValues["monitor_interval"] = 45,
longValues["min_notif_changes"] = 5; longValues["min_notify_changes"] = 5;
longValues["monitor_log_frequency"] = 5; longValues["monitor_log_frequency"] = 5;
// Number of n sync runs before performing a full local scan of sync_dir // Number of n sync runs before performing a full local scan of sync_dir
// By default 10 which means every ~7.5 minutes a full disk scan of sync_dir will occur // By default 10 which means every ~7.5 minutes a full disk scan of sync_dir will occur
@ -220,7 +220,7 @@ final class Config
&boolValues["logout"], &boolValues["logout"],
"min-notif-changes", "min-notif-changes",
"Minimum number of pending incoming changes necessary to trigger a desktop notification", "Minimum number of pending incoming changes necessary to trigger a desktop notification",
&longValues["min_notif_changes"], &longValues["min_notify_changes"],
"monitor|m", "monitor|m",
"Keep monitoring for local and remote changes", "Keep monitoring for local and remote changes",
&boolValues["monitor"], &boolValues["monitor"],

View file

@ -169,7 +169,7 @@ int main(string[] args)
writeln("Config option 'skip_dotfiles' = ", cfg.getValueBool("skip_dotfiles")); writeln("Config option 'skip_dotfiles' = ", cfg.getValueBool("skip_dotfiles"));
writeln("Config option 'skip_symlinks' = ", cfg.getValueBool("skip_symlinks")); writeln("Config option 'skip_symlinks' = ", cfg.getValueBool("skip_symlinks"));
writeln("Config option 'monitor_interval' = ", cfg.getValueLong("monitor_interval")); writeln("Config option 'monitor_interval' = ", cfg.getValueLong("monitor_interval"));
writeln("Config option 'min_notif_changes' = ", cfg.getValueLong("min_notif_changes")); writeln("Config option 'min_notify_changes' = ", cfg.getValueLong("min_notify_changes"));
writeln("Config option 'log_dir' = ", cfg.getValueString("log_dir")); writeln("Config option 'log_dir' = ", cfg.getValueString("log_dir"));
// Is config option drive_id configured? // Is config option drive_id configured?

View file

@ -627,7 +627,7 @@ final class SyncEngine
if (("value" in changes) != null) { if (("value" in changes) != null) {
auto nrChanges = count(changes["value"].array); auto nrChanges = count(changes["value"].array);
if (nrChanges >= cfg.getValueLong("min_notif_changes")) { if (nrChanges >= cfg.getValueLong("min_notify_changes")) {
log.logAndNotify("Processing ", nrChanges, " changes"); log.logAndNotify("Processing ", nrChanges, " changes");
} else { } else {
// There are valid changes // There are valid changes