Skip to content

Scheduled tasks

P2Lab Cache registers three Shopware scheduled tasks. They are dispatched by the standard scheduler worker, so they only fire when one of these is running:

Terminal window
bin/console messenger:consume scheduler

Most production setups already run a scheduler — these tasks plug in transparently.

Drops orphaned rows from the p2lab_cache_entry metadata table — entries that no longer have a corresponding payload in the backend (e.g. because the backend evicted them by TTL, or because the backend was switched).

Default interval: nightly (24 h) Why it matters: keeps the metadata table aligned with the actual backend; dashboard counts stay accurate.

Deletes rows in the p2lab_cache_invalidation_log table older than 30 days.

Default interval: nightly (24 h) Why it matters: the log can grow large on a busy store. The fixed 30-day retention keeps it useful for diagnosis without ballooning.

Deletes rows in the p2lab_cache_reverse_proxy_log table older than 30 days. Same shape as the invalidation log cleanup.

Default interval: nightly (24 h)

Terminal window
bin/console scheduled-task:list

Look for the three p2lab_cache.* entries. If they are missing, the plugin isn’t fully activated — run:

Terminal window
bin/console plugin:refresh
bin/console plugin:install --activate --refresh P2LabCache
bin/console cache:clear

Shopware lets you edit the run interval per task from Settings → System → Scheduled tasks, or directly in the scheduled_task table. Pick a longer interval if your log tables are small and a daily wakeup is wasteful.

To force a task to run once without waiting for the scheduler:

Terminal window
bin/console scheduled-task:run-single p2lab_cache.cleanup_invalidation_log

Useful in scripts that wipe logs after a maintenance window.