Skip to content

Commit

Permalink
prevent duplicate events
Browse files Browse the repository at this point in the history
  • Loading branch information
huebl committed Aug 11, 2023
1 parent 7ccc0dc commit 78148f9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -718,14 +718,16 @@ namespace OpcUaStackServer

for (nodeIt = nodeIdVec.begin(); nodeIt != nodeIdVec.end(); nodeIt++) {
boost::mutex::scoped_lock g(eventHandlerMap.mutex());
eventHandlerBaseVec.clear();
eventHandlerMap.getEvent(*nodeIt, eventHandlerBaseVec);
for (it = eventHandlerBaseVec.begin(); it != eventHandlerBaseVec.end(); it++) {
EventHandlerBase::SPtr eventHandlerBase = *it;

Log(Debug, "fire event")
.parameter("NumberEvents", eventHandlerBaseVec.size())
.parameter("Node", fireEventRequest->nodeId())
.parameter("EventId", eventHandlerBase->eventId());
.parameter("EventId", eventHandlerBase->eventId())
.parameter("NodeVecElement", *nodeIt);

eventHandlerBase->fireEvent(fireEventRequest->nodeId(), fireEventRequest->eventBase());
}
Expand Down

0 comments on commit 78148f9

Please sign in to comment.