Skip to content

Commit bed0dc7

Browse files
committed
Remove unused code
1 parent 6cc7fe2 commit bed0dc7

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

graphdatascience/query_runner/protocol/retry_utils.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
import logging
2-
import signal
32
import typing
4-
from types import FrameType
5-
from typing import Optional
63

7-
from tenacity import RetryCallState, retry_base
8-
9-
10-
class retry_unless_signal(retry_base):
11-
"""Retries unless one of the given signals is raised."""
12-
13-
def __init__(self, signals: list[signal.Signals]) -> None:
14-
self.signal_received = False
15-
16-
def receive_signal(sig: int, frame: Optional[FrameType]) -> None:
17-
logging.debug(f"Received signal {sig}. Interrupting retry.")
18-
self.signal_received = True
19-
20-
try:
21-
for sig in signals:
22-
signal.signal(sig, receive_signal)
23-
except ValueError as e:
24-
# signal.signal() can raise ValueError if this is not called in the main thread (such as when an algorithm is called in a ThreadPool)
25-
logging.debug(f"Cannot set signal handler for retries {e}")
26-
27-
def __call__(self, retry_state: RetryCallState) -> bool:
28-
return not self.signal_received
4+
from tenacity import RetryCallState
295

306

317
def before_log(

0 commit comments

Comments
 (0)