Skip to content

Commit

Permalink
fix: failed request writer (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Apr 22, 2024
1 parent 00cd67f commit bd20d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dank_mids/_debugging/failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, chainid: int, failure_type: Type[BaseException]):
if not issubclass(failure_type, BaseException):
raise TypeError(f"`failure_type` must be an Exception type. You passed {failure_type}")
self.failure_type = failure_type
self.record_failure = ProcessingQueue(self._record_failure, num_workers=1, return_data=True)
self.record_failure = ProcessingQueue(self._record_failure, num_workers=1, return_data=False)
@cached_property
def filename(self) -> str:
return f"{int(datetime.now().timestamp())}_{self.failure_type.__name__}s.csv"
Expand All @@ -28,4 +28,4 @@ async def _record_failure(self, e: Exception, request_type: str, request_uid: Un
await self.write_row(request_type, request_uid, request_length, e, request_data)

def record(chainid: int, e: Exception, request_type: str, request_uid: Union[int, str], request_length: Union[int, Literal["unknown"]], request_data: Union[List["Request"], List["PartialRequest"], bytes]) -> None:
FailedRequestWriter(chainid, type(e)).record_failure(e, request_type, request_uid, request_data)
FailedRequestWriter(chainid, type(e)).record_failure(e, request_type, request_uid, request_length, request_data)

0 comments on commit bd20d53

Please sign in to comment.