Skip to content

Commit

Permalink
Fix static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Jun 21, 2024
1 parent 78d3a9c commit 7df0ecd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ethereum_spec_tools/evm_tools/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from io import StringIO, TextIOWrapper
from socket import socket
from threading import Thread
from typing import Any, Optional, Tuple, Union
from typing import Any, Tuple, Union

from platformdirs import user_runtime_dir

Expand Down Expand Up @@ -67,7 +67,9 @@ class _UnixSocketHttpServer(socketserver.UnixStreamServer):
last_response: float
shutdown_timeout: int

def __init__(self, *args: Any, shutdown_timeout: int, **kwargs: Any) -> None:
def __init__(
self, *args: Any, shutdown_timeout: int, **kwargs: Any
) -> None:
self.shutdown_timeout = shutdown_timeout
# Add a 60-second allowance to prevent server from timing out during
# startup
Expand Down Expand Up @@ -122,7 +124,9 @@ def _run(self) -> int:
except IOError:
pass

with _UnixSocketHttpServer((self.uds), _EvmToolHandler, shutdown_timeout=self.timeout) as server:
with _UnixSocketHttpServer(
(self.uds), _EvmToolHandler, shutdown_timeout=self.timeout
) as server:
server.timeout = 7.0
timer = Thread(target=server.check_timeout, daemon=True)
timer.start()
Expand Down

0 comments on commit 7df0ecd

Please sign in to comment.