From 203da2dfb85ddd5e2e60412bd8a28411469bbe15 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Fri, 5 Jun 2020 06:49:23 +1000 Subject: [PATCH] Perform initial sync at startup in monitor mode (#946) * If starting the application up, dont wait for monitor_interval to elapse before first sync attempt --- src/main.d | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.d b/src/main.d index 7de18af7..bf88b65b 100644 --- a/src/main.d +++ b/src/main.d @@ -858,7 +858,15 @@ int main(string[] args) } auto currTime = MonoTime.currTime(); - if (currTime - lastCheckTime > checkInterval) { + // has monitor_interval elapsed or are we at application startup / monitor startup? + // in a --resync scenario, if we have not 're-populated' the database, valid changes will get skipped: + // Monitor directory: ./target + // Monitor directory: target/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby + // [M] Item moved: random_files/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby -> target/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby + // Moving random_files/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby to target/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby + // Skipping uploading this new file as parent path is not in the database: target/2eVPInOMTFNXzRXeNMEoJch5OR9XpGby + // 'target' should be in the DB, it should also exist online, but because of --resync, it does not exist in the database thus parent check fails + if ((currTime - lastCheckTime > checkInterval) || (monitorLoopFullCount == 0)) { // monitor sync loop logOutputMessage = "################################################## NEW LOOP ##################################################"; if (displaySyncOptions) {