refactor(plugins/google_meet): unlink(missing_ok) + hoist uuid import in process_manager
This commit is contained in:
@@ -14,6 +14,7 @@ import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
@@ -132,7 +133,6 @@ def transcript(last: Optional[int] = None) -> Dict[str, Any]:
|
||||
def enqueue_say(text: str) -> Dict[str, Any]:
|
||||
"""Append a ``say`` request to ``<out_dir>/say_queue.jsonl``.
|
||||
Refused when no meeting is active or the active bot is transcribe-only."""
|
||||
import uuid
|
||||
text = (text or "").strip()
|
||||
if not text:
|
||||
return {"ok": False, "reason": "text is required"}
|
||||
@@ -167,9 +167,6 @@ def stop(*, reason: str = "requested") -> Dict[str, Any]:
|
||||
time.sleep(0.5)
|
||||
if _pid_alive(pid):
|
||||
_kill(pid, signal.SIGKILL) # windows-footgun: ok — POSIX-only plugin (google_meet registers no-op on Windows; see __init__.py)
|
||||
try:
|
||||
(_root() / ".active.json").unlink()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
(_root() / ".active.json").unlink(missing_ok=True)
|
||||
return {"ok": True, "reason": reason, "meetingId": active.get("meeting_id"),
|
||||
"transcriptPath": str(Path(out_dir) / "transcript.txt") if out_dir else None}
|
||||
|
||||
Reference in New Issue
Block a user