From 4297f68d418d6d752e9ca30db08f55f671ceb835 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 20 Sep 2018 05:45:22 +0200 Subject: [PATCH] Don't wait(interval) after last entry --- CMakeLists.txt | 2 +- src/mastorss.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 751ccbc..778416b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (mastorss - VERSION 0.8.0 + VERSION 0.8.1 LANGUAGES CXX ) diff --git a/src/mastorss.cpp b/src/mastorss.cpp index 2466905..70687c0 100644 --- a/src/mastorss.cpp +++ b/src/mastorss.cpp @@ -116,7 +116,10 @@ int main(int argc, char *argv[]) return ret; } - sleep_for(seconds(config[profile]["interval"].asUInt64())); + if (rit != entries.rend()) + { // Only sleep if this is not the last entry + sleep_for(seconds(config[profile]["interval"].asUInt64())); + } } // Write the new last_entry only if no error happened.