(vid: str, pr_blob: str, strategy_id: str)
| 543 | |
| 544 | |
| 545 | def _spawn_telemetry(vid: str, pr_blob: str, strategy_id: str) -> None: |
| 546 | rec_ids = [] |
| 547 | try: |
| 548 | rec_ids = _extract_recommended_video_ids(pr_blob)[:8] |
| 549 | except Exception: |
| 550 | pass |
| 551 | ids = [vid] + rec_ids |
| 552 | args = [sys.executable, str(Path(__file__).resolve()), |
| 553 | "--telemetry", strategy_id, ",".join(ids)] |
| 554 | try: |
| 555 | subprocess.Popen( |
| 556 | args, |
| 557 | stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, |
| 558 | stdin=subprocess.DEVNULL, |
| 559 | start_new_session=True, |
| 560 | env=os.environ.copy(), |
| 561 | ) |
| 562 | except Exception as e: |
| 563 | _log(f"failed to spawn telemetry: {e}") |
| 564 | |
| 565 | |
| 566 | def _extract_recommended_video_ids(pr_blob: str) -> list[str]: |
no test coverage detected