Allow DatabaseQueue to be extended with non integer based ids

Created on 20 September 2024, 3 months ago

Problem/Motivation

Hello!

In an effort to reduce duplicate queue items we have extended the DatabaseQueue plugin in Alternative approach to unique queue using upsert Needs review - and as part of the implementation we set item_id as a hash of the data so that we can use an upsert query when adding items to the queue.

Part of that implementation involved duplicating several methods in the plugin in order to remove the casting of item_id to an integer.

To make it easier to extend this plugin - can this casting be dropped? As far as I can see there are example tests with non integer based item items and the tests pass without it. Otherwise, perhaps we can introduce a small helper method such as castItemId that we can override. Our aim is to reduce code duplication since we have had to extend claimItem, claimItemMultiple, selectPage and releaseItemMultiple.

Steps to reproduce

See code duplication in Alternative approach to unique queue using upsert Needs review

Proposed resolution

TBC

Remaining tasks

Agree on approach

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024