Loading...
 
Skip to main content

Background Job Queue System


Starting from Tiki 30, long-running operations (e.g. PDF generation, instance creation, maintenance tasks) can be executed asynchronously using a background job queue system. This avoids timeouts during HTTP requests and improves responsiveness for users.

The system provides:

  • A task queue table (tiki_queued_tasks)
  • A task lifecycle tracking status and result
  • A CLI worker to process tasks
  • UI integration for monitoring queued tasks

Task Lifecycle


A task moves through the following standard lifecycle:

[ pending ] → [ running ] → [ completed/ failed ]

Where:

  • pending — Task is waiting to be executed
  • running — T ask is being processed
  • completed — Task executed successfully
  • failed Task — encountered an error

CLI Commands

  • Run queue (once):
    php console.php queue:process
  • Run continuously:
    php console.php queue:process --loop (Ctrl+C to stop the process)

Example — PDF export

  • Enable the queued tasks feature
    1. Log in as an administrator.
    2. Open Admin → General (tiki-admin.php?page=general).
    3. Find the Queued Tasks option.

    Image
    Click to expand

  • Confirm that the Queued Tasks admin page is now visible
    Image
    Click to expand

  • Trigger a PDF export from the Browser
    Image
    Click to expand


    Expected UI behavior: A banner that includes a link to the queued task
    Image
    Click to expand

  • Inspect queued task in Admin UI
    Image
    Click to expand

If the Job Failed


Open the task details and read the error shown in Output.
The message usually explains the cause, such as:

  • missing permissions
  • invalid configuration
  • missing dependencies
  • PHP/runtime exceptions
  • network or database issues


Fix the underlying problem (or contact your administrator if needed).

Failed tasks are not retried automatically.
Once the issue is corrected, simply repeat the action that created the task.