feat(daily-prep): persist last prep run to a log file and serve it via GetLastPrepLog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -582,6 +582,19 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
await new DailyNoteRepository(ctx).DeleteAsync(id);
|
||||
}
|
||||
|
||||
public Task<string> GetLastPrepLog()
|
||||
{
|
||||
var path = DailyPrepPrompt.LogPath();
|
||||
if (!File.Exists(path)) return Task.FromResult(string.Empty);
|
||||
|
||||
const int maxBytes = 256 * 1024;
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
var text = bytes.Length <= maxBytes
|
||||
? System.Text.Encoding.UTF8.GetString(bytes)
|
||||
: System.Text.Encoding.UTF8.GetString(bytes, bytes.Length - maxBytes, maxBytes);
|
||||
return Task.FromResult(text);
|
||||
}
|
||||
|
||||
public async Task<int> ClearMyDay()
|
||||
{
|
||||
await using var ctx = await _dbFactory.CreateDbContextAsync();
|
||||
|
||||
Reference in New Issue
Block a user