From 533c27d9cb2882649d268de67b49a386220a53fd Mon Sep 17 00:00:00 2001 From: Maurice ONeal Date: Sun, 12 Mar 2023 17:19:11 -0400 Subject: [PATCH] v.20.t10 Event files are still not concatenating. I suspect the issue was in eventLoop() caching old event objects. Changed up the loop to so it will grab latest event object on each iteration. --- src/common.h | 2 +- src/main.cpp | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/common.h b/src/common.h index f97be62..2529dac 100644 --- a/src/common.h +++ b/src/common.h @@ -38,7 +38,7 @@ using namespace std; using namespace std::filesystem; using namespace std::chrono; -#define APP_VER "2.0.t9" +#define APP_VER "2.0.t10" #define APP_NAME "Motion Watch" #define REC_LOG_NAME "rec_log_lines.html" #define DET_LOG_NAME "det_log_lines.html" diff --git a/src/main.cpp b/src/main.cpp index fc7a9d7..ed463e6 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,14 +33,10 @@ void eventLoop(shared_t *share) auto event = it->second; auto timeDiff = genEpoch() - event.createTime; - // future time protection. this should never occur but - // this is in place in case the system time is incorrect. - if (timeDiff > 0) + // wait at least 61 seconds before processing the event in + // queue. + if ((timeDiff > 0) && (timeDiff > 60)) { - // wait at least 61 seconds before processing the event in - // queue. - if (timeDiff < 61) sleep(61 - timeDiff); - try { wrOutVod(event, share);