Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
vidai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
vidai
Commits
9344ec30
Commit
9344ec30
authored
Oct 09, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make debug messages conditional on --debug flag to reduce noise
parent
b6a0a398
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
backend.py
vidai/backend.py
+9
-4
comm.py
vidai/comm.py
+9
-4
No files found.
vidai/backend.py
View file @
9344ec30
...
...
@@ -56,15 +56,20 @@ def handle_web_message(message: Message, client_sock=None) -> Message:
from
.config
import
get_analysis_backend
backend
=
get_analysis_backend
()
worker_key
=
f
'analysis_{backend}'
from
.config
import
get_debug
if
get_debug
():
print
(
f
"DEBUG: Backend forwarding analyze_request {message.msg_id} to worker {worker_key}"
)
if
worker_key
in
worker_sockets
:
# Forward to local worker
msg_json
=
f
'{{"msg_type": "{message.msg_type}", "msg_id": "{message.msg_id}", "data": {message.data}}}
\n
'
if
get_debug
():
print
(
f
"DEBUG: Sending to worker: {msg_json.strip()}"
)
worker_sockets
[
worker_key
]
.
sendall
(
msg_json
.
encode
(
'utf-8'
))
if
get_debug
():
print
(
f
"DEBUG: Sent to worker {worker_key}"
)
return
None
# No immediate response
else
:
if
get_debug
():
print
(
f
"DEBUG: Worker {worker_key} not found in worker_sockets"
)
return
Message
(
'error'
,
message
.
msg_id
,
{
'error'
:
f
'Worker {worker_key} not available'
})
elif
message
.
msg_type
==
'train_request'
:
...
...
vidai/comm.py
View file @
9344ec30
...
...
@@ -27,6 +27,7 @@ import os
from
typing
import
Dict
,
Any
,
Optional
from
dataclasses
import
dataclass
from
.compat
import
get_socket_path
,
is_unix_sockets_supported
from
.config
import
get_debug
@
dataclass
...
...
@@ -70,6 +71,7 @@ class SocketCommunicator:
'data'
:
message
.
data
})
.
encode
(
'utf-8'
)
full_data
=
data
+
b
'
\n
'
if
get_debug
():
print
(
f
"DEBUG: SocketCommunicator sending: {full_data}"
)
self
.
sock
.
sendall
(
full_data
)
...
...
@@ -153,6 +155,7 @@ class SocketServer:
messages
=
decoded
.
split
(
'
\n
'
)
for
msg_str
in
messages
:
if
msg_str
.
strip
():
if
get_debug
():
print
(
f
"DEBUG: SocketServer processing message: {repr(msg_str)}"
)
try
:
msg_data
=
json
.
loads
(
msg_str
)
...
...
@@ -161,6 +164,7 @@ class SocketServer:
msg_id
=
msg_data
[
'msg_id'
],
data
=
msg_data
[
'data'
]
)
if
get_debug
():
print
(
f
"DEBUG: SocketServer parsed message: {message}"
)
response
=
self
.
message_handler
(
message
,
client_sock
)
if
response
:
...
...
@@ -171,6 +175,7 @@ class SocketServer:
})
.
encode
(
'utf-8'
)
client_sock
.
sendall
(
resp_data
+
b
'
\n
'
)
except
json
.
JSONDecodeError
as
e
:
if
get_debug
():
print
(
f
"DEBUG: SocketServer JSON decode error: {e}"
)
pass
except
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment