Skip to content

Commit 1c009f2

Browse files
committed
Register terminate_zmq with atexit
1 parent 3975bbd commit 1c009f2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

concore.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
import logging
33
import os
4+
import atexit
45
from ast import literal_eval
56
import sys
67
import re
@@ -104,6 +105,8 @@ def terminate_zmq():
104105
port.context.term()
105106
except Exception as e:
106107
logging.error(f"Error while terminating ZMQ port {port.address}: {e}")
108+
109+
atexit.register(terminate_zmq)
107110
# --- ZeroMQ Integration End ---
108111

109112

0 commit comments

Comments
 (0)