Skip to content

Update QueueItemRepository.php - #75

Open
Usytech51 wants to merge 1 commit into
packlink-dev:masterfrom
Usytech51:patch-4
Open

Usytech51 wants to merge 1 commit into
packlink-dev:masterfrom
Usytech51:patch-4

Conversation

@Usytech51

Copy link
Copy Markdown

fix(queue): disable SQL cache when reading queued items

QueueItemRepository::findOldestQueuedItems() read the queue with executeS() and the default $use_cache = true. The query uses a nested subquery with an alias, which PrestaShop's cache invalidation does not always associate with the queue table, so the cached result was never purged when new tasks were enqueued.

As a result the task runner read a stale queue snapshot from Memcached and did not see newly enqueued SendDraftTask items, so shipment drafts for new orders stayed pending until the queue was read fresh (e.g. from the module config page).

Reading without cache makes the runner always see freshly enqueued tasks.

fix(queue): disable SQL cache when reading queued items

QueueItemRepository::findOldestQueuedItems() read the queue with
executeS() and the default $use_cache = true. The query uses a nested
subquery with an alias, which PrestaShop's cache invalidation does not
always associate with the queue table, so the cached result was never
purged when new tasks were enqueued.

As a result the task runner read a stale queue snapshot from Memcached
and did not see newly enqueued SendDraftTask items, so shipment drafts
for new orders stayed pending until the queue was read fresh (e.g. from
the module config page).

Reading without cache makes the runner always see freshly enqueued tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant