feat: database-backed cron job queue replacing JSON file system

Replace file-based JSON cron queue with DB-backed job queue (pp_cron_jobs,
pp_cron_schedules). New Domain\CronJob module: CronJobType (constants),
CronJobRepository (CRUD, atomic fetch, retry/backoff), CronJobProcessor
(orchestration with handler registration). Priority ordering guarantees
apilo_send_order (40) runs before sync tasks (50). Includes cron.php auth
protection, race condition fix in fetchNext, API response validation,
and DI wiring across all entry points. 41 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 13:29:11 +01:00
parent 4cbe1c2cb8
commit bab273b7a5
19 changed files with 1723 additions and 417 deletions

View File

@@ -177,9 +177,10 @@ class App
'ShopOrder' => function() {
global $mdb;
$orderRepo = new \Domain\Order\OrderRepository( $mdb );
$cronJobRepo = new \Domain\CronJob\CronJobRepository( $mdb );
return new \front\Controllers\ShopOrderController(
$orderRepo,
new \Domain\Order\OrderAdminService( $orderRepo )
new \Domain\Order\OrderAdminService( $orderRepo, null, null, null, $cronJobRepo )
);
},
'ShopProducer' => function() {