From 3ac597235b1458a6f3154458b4000e09d8dfa2ec Mon Sep 17 00:00:00 2001 From: Max Holland Date: Tue, 17 Dec 2024 15:49:37 +0000 Subject: [PATCH] Fix context for logging (#3322) --- server/ai_live_video.go | 2 +- server/ai_mediaserver.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/ai_live_video.go b/server/ai_live_video.go index bd96128dc..3f1a59aac 100644 --- a/server/ai_live_video.go +++ b/server/ai_live_video.go @@ -30,7 +30,7 @@ func startTricklePublish(ctx context.Context, url *url.URL, params aiRequestPara } // Start payments which probes a segment every "paymentProcessInterval" and sends a payment - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(ctx) priceInfo := sess.OrchestratorInfo.PriceInfo var paymentProcessor *LivePaymentProcessor if priceInfo != nil && priceInfo.PricePerUnit != 0 { diff --git a/server/ai_mediaserver.go b/server/ai_mediaserver.go index dc1a43c8d..cca993883 100644 --- a/server/ai_mediaserver.go +++ b/server/ai_mediaserver.go @@ -481,7 +481,8 @@ func (ls *LivepeerServer) StartLiveVideo() http.Handler { requestID := string(core.RandomManifestID()) ctx = clog.AddVal(ctx, "request_id", requestID) - clog.Infof(ctx, "Received live video AI request for %s. pipelineParams=%v streamID=%s", streamName, pipelineParams, streamID) + ctx = clog.AddVal(ctx, "stream_id", streamID) + clog.Infof(ctx, "Received live video AI request for %s. pipelineParams=%v", streamName, pipelineParams) // Kick off the RTMP pull and segmentation as soon as possible ssr := media.NewSwitchableSegmentReader()