|
7 | 7 | import subprocess |
8 | 8 | import time |
9 | 9 | from datetime import datetime |
10 | | -from functools import partial, singledispatch, wraps |
| 10 | +from functools import partial, singledispatch |
11 | 11 | from pathlib import Path |
12 | 12 | from threading import Thread |
13 | | -from typing import Any, Callable, Dict, List, NamedTuple, Tuple |
| 13 | +from typing import Any, Dict, List, NamedTuple, Tuple |
14 | 14 |
|
15 | 15 | import mrcfile |
16 | 16 | import numpy as np |
@@ -96,28 +96,6 @@ class JobIDs(NamedTuple): |
96 | 96 | client_id: int |
97 | 97 |
|
98 | 98 |
|
99 | | -def record_failure( |
100 | | - f: Callable, record_queue: str = "", is_callback: bool = True |
101 | | -) -> Callable: |
102 | | - @wraps(f) |
103 | | - def wrapper(*args, **kwargs): |
104 | | - try: |
105 | | - return f(*args, **kwargs) |
106 | | - except Exception: |
107 | | - logger.warning(f"Call to {f} failed", exc_info=True) |
108 | | - if _transport_object and is_callback: |
109 | | - if not record_queue: |
110 | | - machine_config = get_machine_config() |
111 | | - record_queue = ( |
112 | | - machine_config.failure_queue |
113 | | - or f"dlq.{_transport_object.feedback_queue}" |
114 | | - ) |
115 | | - _transport_object.send(record_queue, args[0], new_connection=True) |
116 | | - return None |
117 | | - |
118 | | - return wrapper |
119 | | - |
120 | | - |
121 | 99 | def sanitise(in_string: str) -> str: |
122 | 100 | return in_string.replace("\r\n", "").replace("\n", "") |
123 | 101 |
|
@@ -1935,7 +1913,6 @@ def _register_initial_model(message: dict, _db=murfey_db, demo: bool = False): |
1935 | 1913 | _db.close() |
1936 | 1914 |
|
1937 | 1915 |
|
1938 | | -@record_failure |
1939 | 1916 | def _flush_spa_preprocessing(message: dict): |
1940 | 1917 | session_id = message["session_id"] |
1941 | 1918 | stashed_files = murfey_db.exec( |
@@ -2045,7 +2022,6 @@ def _flush_spa_preprocessing(message: dict): |
2045 | 2022 | return None |
2046 | 2023 |
|
2047 | 2024 |
|
2048 | | -@record_failure |
2049 | 2025 | def _flush_tomography_preprocessing(message: dict): |
2050 | 2026 | session_id = message["session_id"] |
2051 | 2027 | instrument_name = ( |
|
0 commit comments