mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +02:00
Change synclist override flag to false as default when not using sync_list (#745)
* Set 'syncListConfiguredOverride' to false by default, only set to true at start if sync_list is true * Remove logAndNotify as it is excessive for each change bundle to inform the desktop * Add a log entry when a monitor sync loop with OneDrive starts & completes
This commit is contained in:
parent
aaa26a4e7e
commit
217d72486d
12
src/main.d
12
src/main.d
|
@ -690,15 +690,21 @@ int main(string[] args)
|
|||
auto logMonitorCounter = 0;
|
||||
auto fullScanCounter = 0;
|
||||
bool fullScanRequired = true;
|
||||
bool syncListConfiguredOverride = true;
|
||||
bool syncListConfiguredOverride = false;
|
||||
// if sync list is configured, set to true
|
||||
if (syncListConfigured) {
|
||||
syncListConfiguredOverride = true;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (!cfg.getValueBool("download_only")) m.update(online);
|
||||
auto currTime = MonoTime.currTime();
|
||||
if (currTime - lastCheckTime > checkInterval) {
|
||||
// log monitor output suppression
|
||||
logMonitorCounter += 1;
|
||||
if (logMonitorCounter > logInterval)
|
||||
if (logMonitorCounter > logInterval) {
|
||||
logMonitorCounter = 1;
|
||||
}
|
||||
|
||||
// full scan of sync_dir
|
||||
fullScanCounter += 1;
|
||||
|
@ -727,6 +733,7 @@ int main(string[] args)
|
|||
}
|
||||
try {
|
||||
// perform a --monitor sync
|
||||
log.vlog("Starting a sync with OneDrive");
|
||||
performSync(sync, cfg.getValueString("single_directory"), cfg.getValueBool("download_only"), cfg.getValueBool("local_first"), cfg.getValueBool("upload_only"), (logMonitorCounter == logInterval ? MONITOR_LOG_QUIET : MONITOR_LOG_SILENT), fullScanRequired, syncListConfiguredOverride);
|
||||
if (!cfg.getValueBool("download_only")) {
|
||||
// discard all events that may have been generated by the sync
|
||||
|
@ -743,6 +750,7 @@ int main(string[] args)
|
|||
log.log("Cannot initialize connection to OneDrive");
|
||||
}
|
||||
// performSync complete, set lastCheckTime to current time
|
||||
log.vlog("Sync with OneDrive is complete");
|
||||
fullScanRequired = false;
|
||||
if (syncListConfigured) {
|
||||
syncListConfiguredOverride = false;
|
||||
|
|
|
@ -852,8 +852,10 @@ final class SyncEngine
|
|||
|
||||
if (!performFullItemScan){
|
||||
// Display the number of changes we are processing
|
||||
// OneDrive ships 'changes' in ~200 bundles. These messages then get displayed for each bundle
|
||||
if (nrChanges >= cfg.getValueLong("min_notify_changes")) {
|
||||
log.logAndNotify("Processing ", nrChanges, " changes");
|
||||
// verbose log, no 'notify' .. it is over the top
|
||||
log.vlog("Processing ", nrChanges, " changes");
|
||||
} else {
|
||||
// There are valid changes
|
||||
log.vdebug("Number of changes from OneDrive to process: ", nrChanges);
|
||||
|
@ -862,7 +864,8 @@ final class SyncEngine
|
|||
// Do not display anything unless we are doing a verbose debug as due to #658 we are essentially doing a --resync each time when using sync_list
|
||||
// Display the number of items we are processing
|
||||
if (nrChanges >= cfg.getValueLong("min_notify_changes")) {
|
||||
log.logAndNotify("Processing ", nrChanges, " OneDrive items to ensure consistent state due to sync_list being used");
|
||||
// verbose log, no 'notify' .. it is over the top
|
||||
log.vlog("Processing ", nrChanges, " OneDrive items to ensure consistent state due to sync_list being used");
|
||||
} else {
|
||||
// There are valid changes
|
||||
log.vdebug("Number of items from OneDrive to process: ", nrChanges);
|
||||
|
|
Loading…
Reference in a new issue