feat(scheduler): add pagination to skipped jobs and filter manager start events

- Implement pagination for skipped jobs display with 20 items per page
- Add pagination controls (previous/next buttons) to the scheduled jobs view
- Exclude ScheduledJobManager "started" events from run logs, keeping only "completed" events
- Add ShouldBeEncrypted interface to ScheduledTaskJob for secure queue handling
- Update log filtering to fetch 500 recent skips and slice for pagination
- Use Log facade instead of fully qualified class name
This commit is contained in:
Andras Bacsai committed 2026-02-28 16:23:58 +01:00
1 parent a0c177f6f2
commit 63be5928ab
7 files changed
+101 -5

No files matched your search

@@ -173,6 +173,42 @@ test('scheduler log parser parses skip entries correctly', function () {
@unlink($logPath);
});
test('scheduler log parser excludes started events from runs', function () {
$logPath = storage_path('logs/scheduled-test-started-filter.log');
$logDir = dirname($logPath);
if (! is_dir($logDir)) {
mkdir($logDir, 0755, true);
}
// Temporarily rename existing logs so they don't interfere
$existingLogs = glob(storage_path('logs/scheduled-*.log'));
$renamed = [];
foreach ($existingLogs as $log) {
$tmp = $log.'.bak';
rename($log, $tmp);
$renamed[$tmp] = $log;
}
$logPath = storage_path('logs/scheduled-'.now()->format('Y-m-d').'.log');
$lines = [
'['.now()->format('Y-m-d H:i:s').'] production.INFO: ScheduledJobManager started {}',
'['.now()->format('Y-m-d H:i:s').'] production.INFO: ScheduledJobManager completed {"duration_ms":74,"dispatched":1,"skipped":13}',
];
file_put_contents($logPath, implode("\n", $lines)."\n");
$parser = new SchedulerLogParser;
$runs = $parser->getRecentRuns();
expect($runs)->toHaveCount(1);
expect($runs->first()['message'])->toContain('completed');
// Cleanup
@unlink($logPath);
foreach ($renamed as $tmp => $original) {
rename($tmp, $original);
}
});
test('scheduler log parser filters by team id', function () {
$logPath = storage_path('logs/scheduled-'.now()->format('Y-m-d').'.log');
$logDir = dirname($logPath);