mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-08 00:42:13 +02:00
Display 'Sync with OneDrive is complete' when using --synchronize (#2229)
* When exiting the application when using --synchronize, display that the sync is complete if we are exiting cleanly and all sync operations are complete
This commit is contained in:
parent
62859609b7
commit
f853b129cd
13
src/main.d
13
src/main.d
|
@ -56,6 +56,11 @@ int main(string[] args)
|
||||||
bool displayMemoryUsage = false;
|
bool displayMemoryUsage = false;
|
||||||
bool displaySyncOptions = false;
|
bool displaySyncOptions = false;
|
||||||
bool cleanupLocalFilesGlobal = false;
|
bool cleanupLocalFilesGlobal = false;
|
||||||
|
bool monitorConfigured = false;
|
||||||
|
|
||||||
|
// start and finish messages
|
||||||
|
string startMessage = "Starting a sync with OneDrive";
|
||||||
|
string finishMessage = "Sync with OneDrive is complete";
|
||||||
|
|
||||||
// hash file permission values
|
// hash file permission values
|
||||||
string hashPermissionValue = "600";
|
string hashPermissionValue = "600";
|
||||||
|
@ -65,6 +70,9 @@ int main(string[] args)
|
||||||
scope(exit) {
|
scope(exit) {
|
||||||
// detail what scope was called
|
// detail what scope was called
|
||||||
log.vdebug("Exit scope called");
|
log.vdebug("Exit scope called");
|
||||||
|
if (!monitorConfigured) {
|
||||||
|
log.log(finishMessage);
|
||||||
|
}
|
||||||
// Display memory details
|
// Display memory details
|
||||||
if (displayMemoryUsage) {
|
if (displayMemoryUsage) {
|
||||||
log.displayMemoryUsagePreGC();
|
log.displayMemoryUsagePreGC();
|
||||||
|
@ -827,6 +835,8 @@ int main(string[] args)
|
||||||
} else {
|
} else {
|
||||||
// Running as --monitor
|
// Running as --monitor
|
||||||
log.error("Unable to reach Microsoft OneDrive API service at this point in time, re-trying network tests\n");
|
log.error("Unable to reach Microsoft OneDrive API service at this point in time, re-trying network tests\n");
|
||||||
|
// set flag for exit scope
|
||||||
|
monitorConfigured = true;
|
||||||
|
|
||||||
// re-try network connection to OneDrive
|
// re-try network connection to OneDrive
|
||||||
// https://github.com/abraunegg/onedrive/issues/1184
|
// https://github.com/abraunegg/onedrive/issues/1184
|
||||||
|
@ -1565,11 +1575,8 @@ int main(string[] args)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// performance timing
|
// performance timing
|
||||||
SysTime startSyncProcessingTime = Clock.currTime();
|
SysTime startSyncProcessingTime = Clock.currTime();
|
||||||
string startMessage = "Starting a sync with OneDrive";
|
|
||||||
string finishMessage = "Sync with OneDrive is complete";
|
|
||||||
|
|
||||||
// perform a --monitor sync
|
// perform a --monitor sync
|
||||||
if ((cfg.getValueLong("verbose") > 0) || (logMonitorCounter == logInterval) || (fullScanRequired) ) {
|
if ((cfg.getValueLong("verbose") > 0) || (logMonitorCounter == logInterval) || (fullScanRequired) ) {
|
||||||
|
|
Loading…
Reference in a new issue