refactor: 优化 DrawHallSnapshotBuilder 和权限管理逻辑

- 在 DrawHallSnapshotBuilder 中简化数据获取逻辑,仅保留必要字段,更新状态表示方式。
- 在 AdminAuthorizationRegistry 中整合接入站点权限定义,提升权限管理的灵活性与可维护性。
- 更新调度任务配置,确保任务在单一服务器上运行,避免重叠执行,提高系统稳定性。
- 增强测试用例,确保新逻辑的正确性与稳定性。
This commit is contained in:
2026-05-27 16:51:08 +08:00
parent a10135d6ee
commit a60ce8caad
10 changed files with 434 additions and 32 deletions

View File

@@ -170,16 +170,24 @@ return Application::configure(basePath: dirname(__DIR__))
})
->withSchedule(function (Schedule $schedule): void {
/** 开奖时刻后尽快跑 RNG/冷静期,避免大厅在 0:00 卡住最多 1 分钟 */
$schedule->command('lottery:draw-tick')->everyTenSeconds();
$schedule->command('lottery:draw-tick')
->everyTenSeconds()
->withoutOverlapping()
->onOneServer();
$schedule->command('lottery:wallet-transfer-reconcile --lookback-hours=24 --stale-minutes=15 --limit=1000')
->everyTenMinutes()
->withoutOverlapping();
->withoutOverlapping()
->onOneServer();
$schedule->command('lottery:ticket-pending-confirm-reconcile --stale-minutes=5 --limit=500')
->everyMinute()
->withoutOverlapping();
->withoutOverlapping()
->onOneServer();
/** @see docs/01-界面文档.md §2.1 `draw.countdown` */
if (config('lottery.realtime_hall_countdown', true)) {
$schedule->command('lottery:hall-countdown')->everySecond();
$schedule->command('lottery:hall-countdown')
->everySecond()
->withoutOverlapping()
->onOneServer();
}
})
->create();