14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- from . import service , handler , VTNService
18
17
import asyncio
19
- from openleadr import utils , errors , enums
20
18
import logging
19
+
20
+ from openleadr import utils , errors , enums
21
+ from . import service , handler , VTNService
22
+
21
23
logger = logging .getLogger ('openleadr' )
22
24
23
25
@@ -28,7 +30,7 @@ def __init__(self, vtn_id, polling_method='internal'):
28
30
super ().__init__ (vtn_id )
29
31
self .polling_method = polling_method
30
32
self .events = {}
31
- self .completed_event_ids = {} # Holds the ids of completed events
33
+ self .completed_event_ids = {} # Holds the ids of completed events
32
34
self .event_callbacks = {}
33
35
self .event_opt_types = {}
34
36
self .event_delivery_callbacks = {}
@@ -41,7 +43,7 @@ async def request_event(self, payload):
41
43
ven_id = payload ['ven_id' ]
42
44
if self .polling_method == 'internal' :
43
45
if ven_id in self .events and self .events [ven_id ]:
44
- events = utils .order_events (self .events [ven_id ])
46
+ events = utils .order_events (self .events [ven_id ]. copy () )
45
47
for event in events :
46
48
event_status = utils .getmember (event , 'event_descriptor.event_status' )
47
49
# Pop the event from the events so that this is the last time it is communicated
0 commit comments