changeset 5395:c1037a755cee

housekeeper: added sleep when idle
author Alain Mazy <am@osimis.io>
date Fri, 06 Oct 2023 16:46:51 +0200
parents 002ba12a8bee
children c5f1865aaa3b
files NEWS OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Oct 03 11:55:43 2023 +0200
+++ b/NEWS	Fri Oct 06 16:46:51 2023 +0200
@@ -23,6 +23,7 @@
 * Prevent the leak of the full path of the source files in the binaries
 * Fix loading of DCMTK dictionary in the MultitenantDicom plugin when built dynamically:
   https://discourse.orthanc-server.org/t/dimse-failure-using-multitenant-plugin/3665
+* Housekeeper: Introduced a 'sleep' to lower CPU usage when idle.
 
 
 Version 1.12.1 (2023-07-04)
--- a/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp	Tue Oct 03 11:55:43 2023 +0200
+++ b/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp	Fri Oct 06 16:46:51 2023 +0200
@@ -703,6 +703,8 @@
         OrthancPlugins::LogInfo("Housekeeper: entering quiet period");
         loggedNotRightPeriodChangeMessage = true;
       }
+
+      boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
     }
   }