mirror of https://github.com/skygpu/skynet.git
Add more logging on msg passing
parent
55781688cd
commit
2b0ed25605
|
@ -117,9 +117,9 @@ async def open_rpc_service(sock, dgpu_bus, db_pool, tls_whitelist, tls_key):
|
|||
async def dgpu_image_streamer():
|
||||
nonlocal wip_reqs, fin_reqs
|
||||
while True:
|
||||
msg = DGPUBusResponse(
|
||||
**json.loads(
|
||||
(await dgpu_bus.arecv()).decode()))
|
||||
raw_msg = (await dgpu_bus.arecv()).decode()
|
||||
logging.info(f'streamer got {len(raw_msg)} bytes.')
|
||||
msg = DGPUBusResponse(**json.loads(raw_msg))
|
||||
|
||||
if security:
|
||||
msg.verify(tls_whitelist[msg.cert])
|
||||
|
|
|
@ -119,8 +119,9 @@ async def open_dgpu_node(
|
|||
|
||||
if ireq.upscaler == 'x4':
|
||||
logging.info('performing upscale...')
|
||||
input_img = image.convert('RGB')
|
||||
up_img, _ = upscaler.enhance(
|
||||
convert_from_image_to_cv2(image), outscale=4)
|
||||
convert_from_image_to_cv2(input_img), outscale=4)
|
||||
|
||||
image = convert_from_cv2_to_image(up_img)
|
||||
logging.info('done')
|
||||
|
@ -238,9 +239,12 @@ async def open_dgpu_node(
|
|||
if security:
|
||||
img_resp.sign(tls_key, cert_name)
|
||||
|
||||
raw_msg = json.dumps(img_resp.to_dict()).encode()
|
||||
|
||||
# send final image
|
||||
await dgpu_sock.asend(
|
||||
json.dumps(img_resp.to_dict()).encode())
|
||||
logging.info('sending img back...')
|
||||
await dgpu_sock.asend(raw_msg)
|
||||
logging.info(f'sent {len(raw_msg)} bytes.')
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logging.info('interrupt caught, stopping...')
|
||||
|
|
Loading…
Reference in New Issue