Skip to content

Commit

Permalink
Merge pull request #472 from classtranscribe/UpdateLogLevel
Browse files Browse the repository at this point in the history
Update log level + Checkplaylists update 14 days after end of semester
  • Loading branch information
angrave authored Jan 28, 2024
2 parents e3afbee + a5b1051 commit 722e0d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions TaskEngine/Tasks/DownloadPlaylistInfoTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task<List<Media>> 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
Expand All @@ -123,7 +123,7 @@ public async Task<List<Media>> 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);

Expand Down
5 changes: 2 additions & 3 deletions TaskEngine/Tasks/QueueAwakerTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 722e0d8

Please sign in to comment.