Skip to content

Commit

Permalink
feat: 若錄影結束但還沒結束直播則不刪除容器
Browse files Browse the repository at this point in the history
  • Loading branch information
konnokai committed Oct 17, 2024
1 parent a3801dd commit 635a243
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions StreamRecordTools/Command/Record/YouTube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,16 @@ public static async Task<ResultType> StartRecord(string id,
Log.Info("將直播轉移至保存點");
MoveVideo(outputPath, "youtube.endstream");

// https://social.msdn.microsoft.com/Forums/en-US/c2c12a9f-dc4c-4c9a-b652-65374ef999d8/get-docker-container-id-in-code?forum=aspdotnetcore
if (Utility.InDocker && !isDisableRedis)
Utility.Redis.GetSubscriber().Publish(new("streamTools.removeById", RedisChannel.PatternMode.Literal), Environment.MachineName);
if (Utility.IsLiveEnd(videoId, false, isDisableRedis))
{
// https://social.msdn.microsoft.com/Forums/en-US/c2c12a9f-dc4c-4c9a-b652-65374ef999d8/get-docker-container-id-in-code?forum=aspdotnetcore
if (Utility.InDocker && !isDisableRedis)
Utility.Redis.GetSubscriber().Publish(new("streamTools.removeById", RedisChannel.PatternMode.Literal), Environment.MachineName);
}
else
{
Log.Warn("還沒關台,保留容器以供紀錄檢查");
}
}
}
else
Expand Down

0 comments on commit 635a243

Please sign in to comment.