feat(daily-prep): add RunDailyPrepNow hub method and expose DailyPrepMaxTasks
This commit is contained in:
@@ -31,7 +31,8 @@ public record AppSettingsDto(
|
||||
bool WorktreeAutoCleanupEnabled,
|
||||
int WorktreeAutoCleanupDays,
|
||||
string? ReportExcludedPaths,
|
||||
int StandupWeekday);
|
||||
int StandupWeekday,
|
||||
int DailyPrepMaxTasks);
|
||||
|
||||
public record WorktreeCleanupDto(int Removed);
|
||||
public record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
|
||||
@@ -79,6 +80,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
private readonly PlanningMergeOrchestrator _planningMergeOrchestrator;
|
||||
private readonly PlanningChainCoordinator _planningChain;
|
||||
private readonly IPrimeScheduleSignal _primeSignal;
|
||||
private readonly IPrimeRunner _primeRunner;
|
||||
private readonly ITaskStateService _state;
|
||||
private readonly IWeekReportService _report;
|
||||
|
||||
@@ -98,6 +100,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
PlanningMergeOrchestrator planningMergeOrchestrator,
|
||||
PlanningChainCoordinator planningChain,
|
||||
IPrimeScheduleSignal primeSignal,
|
||||
IPrimeRunner primeRunner,
|
||||
ITaskStateService state,
|
||||
IWeekReportService report)
|
||||
{
|
||||
@@ -116,6 +119,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
_planningMergeOrchestrator = planningMergeOrchestrator;
|
||||
_planningChain = planningChain;
|
||||
_primeSignal = primeSignal;
|
||||
_primeRunner = primeRunner;
|
||||
_state = state;
|
||||
_report = report;
|
||||
}
|
||||
@@ -217,7 +221,8 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
row.WorktreeAutoCleanupEnabled,
|
||||
row.WorktreeAutoCleanupDays,
|
||||
row.ReportExcludedPaths,
|
||||
row.StandupWeekday);
|
||||
row.StandupWeekday,
|
||||
row.DailyPrepMaxTasks);
|
||||
}
|
||||
|
||||
public async Task UpdateAppSettings(AppSettingsDto dto)
|
||||
@@ -238,6 +243,7 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays,
|
||||
ReportExcludedPaths = dto.ReportExcludedPaths,
|
||||
StandupWeekday = dto.StandupWeekday is >= 0 and <= 6 ? dto.StandupWeekday : (int)DayOfWeek.Wednesday,
|
||||
DailyPrepMaxTasks = dto.DailyPrepMaxTasks,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -533,6 +539,15 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
_primeSignal.Signal();
|
||||
}
|
||||
|
||||
public async Task<bool> RunDailyPrepNow()
|
||||
{
|
||||
var schedule = new PrimeScheduleDto(Guid.Empty, 0, TimeSpan.Zero, true, null, null);
|
||||
var firedAt = DateTimeOffset.Now;
|
||||
var outcome = await _primeRunner.FireAsync(schedule, Context.ConnectionAborted);
|
||||
await _broadcaster.PrimeFired(Guid.Empty, outcome.Success, outcome.Message, firedAt);
|
||||
return outcome.Success;
|
||||
}
|
||||
|
||||
private static DateOnly Day(string iso) => DateOnly.ParseExact(iso, "yyyy-MM-dd", CultureInfo.InvariantCulture);
|
||||
|
||||
public Task<string?> GetWeekReport(string startIso, string endIso) =>
|
||||
|
||||
Reference in New Issue
Block a user