refactor: minor

This commit is contained in:
Marc Cataford 2020-09-27 12:41:07 -04:00
parent 374685ae09
commit ddbed30d06
2 changed files with 3 additions and 4 deletions

View file

@ -97,7 +97,6 @@ class Indexer(IndexerBase):
return []
if current.is_dir():
logger.info(list(current.iterdir()))
for child_path in current.iterdir():
collected.extend(self._discover(str(child_path)))

View file

@ -26,15 +26,15 @@ class Server:
socket.bind((settings.SOCKET_HOST, settings.SOCKET_PORT))
socket.listen()
logger.info(f"Listening on ${settings.SOCKET_HOST}:${settings.SOCKET_PORT}")
logger.info(f"Listening on ${settings.SOCKET_HOST}:{settings.SOCKET_PORT}")
while True:
conn, _ = socket.accept()
query_string = conn.recv(QUERY_STRING_LENGTH)
query_string = conn.recv(QUERY_STRING_LENGTH).decode()
logger.info(f"Query: {query_string}")
if query_string:
try:
query_results = self.indexer.query(query_string.decode())
query_results = self.indexer.query(query_string)
response = json.dumps(query_results).encode()
response_length = str(len(response))
conn.sendall(response_length.encode())