diff options
-rw-r--r-- | git_trace2_event_log_base.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/git_trace2_event_log_base.py b/git_trace2_event_log_base.py index f5424249..2f1aac76 100644 --- a/git_trace2_event_log_base.py +++ b/git_trace2_event_log_base.py | |||
@@ -38,6 +38,8 @@ import tempfile | |||
38 | import threading | 38 | import threading |
39 | 39 | ||
40 | 40 | ||
41 | # Timeout when sending events via socket (applies to connect, send) | ||
42 | SOCK_TIMEOUT = 0.5 # in seconds | ||
41 | # BaseEventLog __init__ Counter that is consistent within the same process | 43 | # BaseEventLog __init__ Counter that is consistent within the same process |
42 | p_init_count = 0 | 44 | p_init_count = 0 |
43 | 45 | ||
@@ -296,6 +298,7 @@ class BaseEventLog: | |||
296 | with socket.socket( | 298 | with socket.socket( |
297 | socket.AF_UNIX, socket.SOCK_STREAM | 299 | socket.AF_UNIX, socket.SOCK_STREAM |
298 | ) as sock: | 300 | ) as sock: |
301 | sock.settimeout(SOCK_TIMEOUT) | ||
299 | sock.connect(path) | 302 | sock.connect(path) |
300 | self._WriteLog(sock.sendall) | 303 | self._WriteLog(sock.sendall) |
301 | return f"af_unix:stream:{path}" | 304 | return f"af_unix:stream:{path}" |