mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:56:31 +00:00
fixed console Log
fix same files problem in python different libs correct command logging in command handler
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import queue
|
||||
import traceback
|
||||
from queue import Queue
|
||||
cimport constants
|
||||
cimport constants_inf
|
||||
from threading import Thread
|
||||
|
||||
from annotation cimport Annotation
|
||||
from inference cimport Inference
|
||||
from loader_client cimport LoaderClient
|
||||
from remote_command cimport RemoteCommand, CommandType
|
||||
from remote_command_handler cimport RemoteCommandHandler
|
||||
from remote_command_inf cimport RemoteCommand, CommandType
|
||||
from remote_command_handler_inf cimport RemoteCommandHandler
|
||||
|
||||
cdef class CommandProcessor:
|
||||
|
||||
@@ -20,7 +20,7 @@ cdef class CommandProcessor:
|
||||
|
||||
def __init__(self, int zmq_port, str loader_zmq_host, int loader_zmq_port, str api_url):
|
||||
self.remote_handler = RemoteCommandHandler(zmq_port, self.on_command)
|
||||
self.inference_queue = Queue(maxsize=constants.QUEUE_MAXSIZE)
|
||||
self.inference_queue = Queue(maxsize=constants_inf.QUEUE_MAXSIZE)
|
||||
self.remote_handler.start()
|
||||
self.running = True
|
||||
self.loader_client = LoaderClient(loader_zmq_host, loader_zmq_port)
|
||||
@@ -37,7 +37,7 @@ cdef class CommandProcessor:
|
||||
continue
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
constants.log('EXIT!')
|
||||
constants_inf.log('EXIT!')
|
||||
|
||||
cdef on_command(self, RemoteCommand command):
|
||||
try:
|
||||
@@ -54,7 +54,7 @@ cdef class CommandProcessor:
|
||||
else:
|
||||
pass
|
||||
except Exception as e:
|
||||
constants.logerror(f"Error handling client: {e}")
|
||||
constants_inf.logerror(f"Error handling client: {e}")
|
||||
|
||||
cdef on_annotation(self, RemoteCommand cmd, Annotation annotation):
|
||||
cdef RemoteCommand response = RemoteCommand(CommandType.INFERENCE_DATA, annotation.serialize())
|
||||
|
||||
Reference in New Issue
Block a user