sutro 0.1.11__tar.gz → 0.1.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sutro might be problematic. Click here for more details.
- {sutro-0.1.11 → sutro-0.1.13}/PKG-INFO +1 -1
- {sutro-0.1.11 → sutro-0.1.13}/pyproject.toml +1 -1
- {sutro-0.1.11 → sutro-0.1.13}/sutro/sdk.py +5 -8
- {sutro-0.1.11 → sutro-0.1.13}/.gitignore +0 -0
- {sutro-0.1.11 → sutro-0.1.13}/LICENSE +0 -0
- {sutro-0.1.11 → sutro-0.1.13}/README.md +0 -0
- {sutro-0.1.11 → sutro-0.1.13}/sutro/__init__.py +0 -0
- {sutro-0.1.11 → sutro-0.1.13}/sutro/cli.py +0 -0
|
@@ -437,8 +437,10 @@ class Sutro:
|
|
|
437
437
|
if not stop_event.is_set(): # Only log if we weren't stopping anyway
|
|
438
438
|
print(f"Heartbeat failed for job {job_id}: {e}")
|
|
439
439
|
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
for _ in range(self.HEARTBEAT_INTERVAL_SECONDS):
|
|
441
|
+
if stop_event.is_set():
|
|
442
|
+
break
|
|
443
|
+
time.sleep(1)
|
|
442
444
|
|
|
443
445
|
@contextmanager
|
|
444
446
|
def stream_heartbeat_session(self, job_id: str, session_token: str) -> Generator[requests.Session, None, None]:
|
|
@@ -449,7 +451,7 @@ class Sutro:
|
|
|
449
451
|
# Run this concurrently in a thread so we can not block main SDK path/behavior
|
|
450
452
|
# but still run heartbeat requests
|
|
451
453
|
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
452
|
-
|
|
454
|
+
executor.submit(
|
|
453
455
|
self.start_heartbeat,
|
|
454
456
|
job_id,
|
|
455
457
|
session_token,
|
|
@@ -462,11 +464,6 @@ class Sutro:
|
|
|
462
464
|
finally:
|
|
463
465
|
# Signal stop and cleanup
|
|
464
466
|
stop_heartbeat.set()
|
|
465
|
-
# Wait for heartbeat to finish with timeout
|
|
466
|
-
try:
|
|
467
|
-
future.result(timeout=1.0)
|
|
468
|
-
except TimeoutError:
|
|
469
|
-
pass
|
|
470
467
|
self.unregister_stream_listener(job_id, session_token)
|
|
471
468
|
session.close()
|
|
472
469
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|