From df6f54db966a53d5b70cb2aa4e78936d233252ec Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Sun, 28 Jan 2024 17:17:52 -0600 Subject: [PATCH 1/2] Change Log Level to Information --- TaskEngine/Tasks/DownloadPlaylistInfoTask.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs b/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs index a85ae98..efc34f7 100644 --- a/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs +++ b/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs @@ -105,7 +105,7 @@ public async Task> GetKalturaPlaylist(Playlist playlist, int index, CTGrpc.JsonString jsonString = null; try { - GetLogger().LogError($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc starting"); + GetLogger().LogInformation($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc starting"); jsonString = await _rpcClient.PythonServerClient.GetKalturaChannelEntriesRPCAsync(new CTGrpc.PlaylistRequest { Url = playlist.PlaylistIdentifier @@ -123,7 +123,7 @@ public async Task> GetKalturaPlaylist(Playlist playlist, int index, } return newMedia; } finally { - GetLogger().LogError($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc complete"); + GetLogger().LogInformation($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc complete"); } JArray jArray = JArray.Parse(jsonString.Json); From a5b10511bfa7696472b5fbb84a6d4956dc4c0bac Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Sun, 28 Jan 2024 17:29:45 -0600 Subject: [PATCH 2/2] Poll playlists upto 14 days after semester ends --- TaskEngine/Tasks/QueueAwakerTask.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TaskEngine/Tasks/QueueAwakerTask.cs b/TaskEngine/Tasks/QueueAwakerTask.cs index 99cb4fc..ed1d722 100644 --- a/TaskEngine/Tasks/QueueAwakerTask.cs +++ b/TaskEngine/Tasks/QueueAwakerTask.cs @@ -280,9 +280,8 @@ private async Task DownloadAllPlaylists() { _downloadPlaylistInfoTask.PurgeQueue(); - var period = DateTime.Now.AddMonths(-6); - //TODO/TOREVIEW: Suggest Term.EndDate < Today plus 2 weeks (but let's check the semester dates in the DB and document this in the frontend) - playlists = await _context.Offerings.Where(o => o.Term.StartDate >= period).SelectMany(o => o.Playlists).Select(p => p.Id).ToListAsync(); + var cutOffDate = DateTimeOffset.Now.AddDays(14); + playlists = await _context.Offerings.Where(o => o.Term.EndDate < cutOffDate).SelectMany(o => o.Playlists).OrderByDescending(p => p.CreatedAt).Select(p => p.Id).ToListAsync(); } GetLogger().LogInformation($"DownloadAllPlaylists(); _downloadPlaylistInfoTask publishing {playlists.Count} tasks"); playlists.ForEach(p => _downloadPlaylistInfoTask.Publish(p));