Skip to content

Commit bdb5ed9

Browse files
committed
Add delay
1 parent 47caa5b commit bdb5ed9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sourceplusplus/control/LiveInstrumentRemote.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,14 @@ def handle_instrument_command(self, command: LiveInstrumentCommand):
8686

8787
def cleanup(self):
8888
while True:
89+
time.sleep(1)
8990
delete = []
9091
for key, val in LiveInstrumentRemote.instruments.items():
9192
if "expires_at" in val[1] and val[1]["expires_at"] < round(time.time() * 1000):
9293
delete.append(key)
9394
for key in delete:
94-
del LiveInstrumentRemote.instruments[key]
95+
instrument = LiveInstrumentRemote.instruments.pop(key)
96+
LiveInstrumentRemote.eb.send(address="spp.processor.status.live-instrument-removed", body={
97+
"instrument": instrument.to_json(),
98+
"occurredAt": round(time.time() * 1000)
99+
})

0 commit comments

Comments
 (0)