diff options
| author | 2019-09-18 10:21:40 +0100 | |
|---|---|---|
| committer | 2019-09-18 10:21:40 +0100 | |
| commit | dce6eee8c9370608783c9ca240b776565b33b631 (patch) | |
| tree | 733d653eae68475d05fa8395ef633f67de55cce0 | |
| parent | through error when fediverse server is configured but crypto is missing (diff) | |
| signature | ||
move _raise_deadline() out of except block to clean up printed stacktrace
| -rw-r--r-- | src/utils/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 8f4920f4..60f25f9d 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -398,10 +398,14 @@ def deadline_process(func: typing.Callable[[], None], seconds: int=10): p = multiprocessing.Process(target=_wrap, args=(func, q)) p.start() + deadlined = False try: success, out = q.get(block=True, timeout=seconds) except queue.Empty: p.kill() + deadlined = True + + if deadlined: _raise_deadline() if success: |
