Skip to content

Commit

Permalink
Correct behavior when receiving response to completed events
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-janssen committed Feb 12, 2024
1 parent f16c72b commit 61a6291
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openleadr/service/event_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ async def request_event(self, payload):
event_status = utils.getmember(event, 'event_descriptor.event_status')
# Pop the event from the events so that this is the last time it is communicated
if event_status == enums.EVENT_STATUS.COMPLETED:
if ven_id not in self.completed_event_ids:
self.completed_event_ids[ven_id] = []
event_id = utils.getmember(event, 'event_descriptor.event_id')
self.completed_event_ids[ven_id].append(event_id)
self.events[ven_id].pop(self.events[ven_id].index(event))
else:
events = None
Expand Down

0 comments on commit 61a6291

Please sign in to comment.