served_ms is request-level (includes queue wait); with-open for image reads
- served_ms measured from request entry, not inside the worker thread: a client that queued 8 s behind a parse no longer sees served_ms: 12 - image file handle bound in a with block (no fd held to GC)
This commit is contained in:
1 parent
46ae7046ea
commit
34a64ec9c6
2 files changed
+6
-5
No files matched your search
@@ -78,7 +78,8 @@ def omniparse(image_path: str = '', image_b64: str = '', format: str = 'view',
|
||||
else f'b64[{len(image_b64)} chars]' if image_b64 else 'no-input')
|
||||
try:
|
||||
if image_path:
|
||||
b64 = base64.b64encode(open(image_path, 'rb').read()).decode()
|
||||
with open(image_path, 'rb') as fh:
|
||||
b64 = base64.b64encode(fh.read()).decode()
|
||||
elif image_b64:
|
||||
b64 = image_b64
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user