Skip to main content

Invalidate Product ID Caches Worker

Rebuilds the product ids of all filters when products or filters were created or changed since its last successful run, and the product ids of all assortments when assortments, their links or their product assignments were. One minute before the last run counts too, for clock skew between instances. Entries that stay the same publish no invalidation.

It repairs entries whose rebuild after a change could not be stored, for example while Redis was unreachable. Removed links and product assignments leave no timestamp, so they are only repaired with the next change the worker detects.

Included in Base Preset

Registered automatically by registerBasePlugins() / registerAllPlugins().

Registration​

import { pluginRegistry } from '@unchainedshop/core';
import { InvalidateProductIdCachesPlugin } from '@unchainedshop/plugins/worker/invalidate-product-id-caches';

pluginRegistry.register(InvalidateProductIdCachesPlugin);

Auto-Scheduling​

Runs every 10 minutes (cron */10 * * * *, retries 0), configured on registration.

Result​

{
"rebuiltFilters": true,
"rebuiltAssortments": false
}

Adapter Details​

PropertyValue
Keyshop.unchained.worker-plugin.invalidate-product-id-caches
TypeINVALIDATE_PRODUCT_ID_CACHES
Auto-ScheduleEvery 10 minutes
Retries0
Sourceworker/invalidate-product-id-caches