create()
create(array $data) : \App\Models\LogSysJob
建账:投递前写入一行待处理记录(载荷快照 + 来源上下文)。
Parameters
| array | $data |
队列日志服务
职责:td_log_sys_job 台账的唯一写入口(投递侧 JobCenter 建账,执行侧 SystemJob 包装 + QueueLogSubscriber 事件兜底共同推进状态机),读侧提供分页筛选、 单条详情(敏感掩码)、监控统计与保留期清理。
状态机:0 待处理 →(领取) 1 处理中 →(execute 成功) 2 成功 1 处理中 →(异常且未耗尽重试) 0 待处理(Laravel 退避重投) 1 处理中 →(重试耗尽/致命) 3 失败(JobFailed 事件落) 0 待处理 →(界面取消) 4 取消(删除原生队列表对应行) 崩溃兜底:worker 被杀/超时 → 任务回队,下一次领取时发现上次尝试未闭合 → 补记「异常中断」。
┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 投递建账 create / setUuid 分区 2 · 状态机推进 markProcessing / markSuccess / markAttemptFailed markFinalFailed / markCancelled 分区 3 · 查询与展示 paginate / show / presentPayload 分区 4 · 重投与取消 redispatch / cancel 分区 5 · 统计与清理 stats / prune 分区 6 · 内部辅助 closeLastAttempt / maskValue / errorOf └────────────────────────────────────────────────────────────┘
closeLastAttempt(array $attemptLog, ?string $error, ?array $result, \Illuminate\Support\Carbon $now, ?int $durationMs) : array
闭合最后一条尝试(finished_at/duration/result/error),返回新数组
| array | $attemptLog | |
| ?string | $error | |
| ?array | $result | |
| \Illuminate\Support\Carbon | $now | |
| ?int | $durationMs |