mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
socket thread stores info if mongo error has happened during subprocess
This commit is contained in:
parent
e0f7752205
commit
5d6f91d614
1 changed files with 10 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import signal
|
||||
import socket
|
||||
|
|
@ -23,6 +24,8 @@ class SocketThread(threading.Thread):
|
|||
self._is_running = False
|
||||
self.finished = False
|
||||
|
||||
self.mongo_error = False
|
||||
|
||||
def stop(self):
|
||||
self._is_running = False
|
||||
|
||||
|
|
@ -97,6 +100,8 @@ class SocketThread(threading.Thread):
|
|||
break
|
||||
|
||||
if data:
|
||||
if data == b"MongoError":
|
||||
self.mongo_error = True
|
||||
connection.sendall(data)
|
||||
|
||||
except Exception as exc:
|
||||
|
|
@ -110,4 +115,9 @@ class SocketThread(threading.Thread):
|
|||
if self.subproc.poll() is None:
|
||||
self.subproc.terminate()
|
||||
|
||||
lines = self.subproc.stdout.readlines()
|
||||
if lines:
|
||||
print("*** Socked Thread stdout ***")
|
||||
for line in lines:
|
||||
os.write(1, line)
|
||||
self.finished = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue