summaryrefslogtreecommitdiffstats
path: root/src/event_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/event_manager.cpp')
-rw-r--r--src/event_manager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/event_manager.cpp b/src/event_manager.cpp
index 9102137..2c09f35 100644
--- a/src/event_manager.cpp
+++ b/src/event_manager.cpp
@@ -62,6 +62,13 @@ void Manager::create(
auto objPath = std::string(OBJ_EVENT) + '/' + eventName + '/' +
std::to_string(id);
+ // check for capping of the events,if cap reached then erase the oldest
+ // event.
+ if (eventQueue.size() == MAX_EVENTS)
+ {
+ eventQueue.pop();
+ }
+
eventQueue.emplace(std::make_unique<Entry>(
objPath,
ms, // Milliseconds since 1970
OpenPOWER on IntegriCloud