Files
opensourcepos/app/Config/Queue.php
T
objecttothisandClaude Sonnet 5 eae8db36a6 feat(jobs): add background job queue execution engine
Adds the queue_jobs, queue_jobs_failed, and job_throttles tables and wires
up BoundedQueueWorker (deadline-bounded queue draining, shared by the
JobRunner filter for web/auto mode and the manual "Process Jobs" UI) gated
by JobThrottleGate. Adds retry limit, retention, and auto-purge settings
to the Job Queue settings tab, and a manual per-queue processing UI on the
Utilities tab. Also adds a second-granularity throttle period and
BaseOsposJob as the shared base for core queue jobs.

This is issue #3833 Phase 2 — no real job types are queued yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-07 17:55:22 +04:00

42 lines
1.2 KiB
PHP

<?php
namespace Config;
use App\Jobs\CustomerImportJob;
use App\Jobs\ItemImportJob;
use CodeIgniter\Queue\Config\Queue as BaseQueue;
/**
* Core queue names: 'default', 'imports', 'api'.
*
* 'plugin.{pluginId}' is reserved for the plugin system (see issue #3833
* Phase 2 / PR #4407) — do not push to a 'plugin.*' queue until the plugin
* infrastructure (PluginManager, BasePluginJob) lands.
*/
class Queue extends BaseQueue
{
public string $defaultHandler = 'database';
public array $jobHandlers = [
'item_import' => ItemImportJob::class,
'customer_import' => CustomerImportJob::class,
];
/**
* Priority convention (issue #3833 Phase 2): 'normal' is the default for
* all jobs; 'high' is for user-facing/time-sensitive work; 'low' is for
* bulk background processing and large imports.
*/
public array $queueDefaultPriority = [
'default' => 'normal',
'imports' => 'normal',
'api' => 'normal',
];
public array $queuePriorities = [
'default' => ['high', 'normal', 'low'],
'imports' => ['high', 'normal', 'low'],
'api' => ['high', 'normal', 'low'],
];
}