fix auth, decryption, api interaction

This commit is contained in:
Alex Bezdieniezhnykh
2025-01-20 10:17:35 +02:00
parent e21dd7e70f
commit ce25ef38b0
12 changed files with 146 additions and 103 deletions
+9 -11
View File
@@ -35,7 +35,14 @@ cdef class CommandProcessor:
self.running = True
def start(self):
threading.Thread(target=self.process_queue, daemon=True).start()
while self.running:
try:
command = self.command_queue.get()
print(f'command is : {command}')
model = self.api_client.load_ai_model()
Inference(model, self.on_annotations).run_inference(command)
except Exception as e:
print(f"Error processing queue: {e}")
cdef on_message(self, FileCommand cmd):
try:
@@ -51,17 +58,8 @@ cdef class CommandProcessor:
handler.send(annotations)
cdef process_queue(self):
while self.running:
try:
command = self.command_queue.get()
model = self.api_client.load_ai_model()
Inference(model, self.on_annotations).run_inference(command)
except Exception as e:
print(f"Error processing queue: {e}")
cdef process_load(self, FileCommand command):
response = self.api_client.load_file(command)
response = self.api_client.load_bytes(command.filename)
handler = self.socket_handler if command.processor_type == ProcessorType.SOCKET else self.rabbit_handler
handler.send(response)