Skip to content

Commit

Permalink
py3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Sep 26, 2024
1 parent d29159b commit 302794e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions fakeredis/_tcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from socketserver import ThreadingTCPServer, StreamRequestHandler
from typing import BinaryIO, Dict, Tuple

from redis import ResponseError

from fakeredis import FakeRedis
from fakeredis import FakeServer

Expand Down Expand Up @@ -96,14 +94,8 @@ def handle(self):
while True:
try:
self.data = self.reader.load()

LOGGER.debug(f">>> {self.client_address[0]}: {self.data}")

try:
res = self.current_client.connection.execute_command(*self.data)
except ResponseError as e:
res = e

res = self.current_client.connection.execute_command(*self.data)
LOGGER.debug(f"<<< {self.client_address[0]}: {res}")
self.writer.dump(res)
except Exception as e:
Expand All @@ -112,7 +104,7 @@ def handle(self):
break

def finish(self) -> None:
del self.server.clients[self.current_client.client_id]
del self.server.clients[self.current_client.client_address]
super().finish()


Expand Down

0 comments on commit 302794e

Please sign in to comment.