codeigniter4 / queue

Queues for the CodeIgniter 4 framework
https://queue.codeigniter.com/
MIT License
44 stars 12 forks source link

Dev: FOR UPDATE SKIP LOCKED issue when retrieving jobs in a queue #42

Open Martin1877 opened 5 months ago

Martin1877 commented 5 months ago

When retrieving jobs in a queue the function skipLocked() is called (QueueJobModel.php). The sql addon "FOR UPDATE SKIP LOCKED" is not available in new but not the newest MariaDB versions. This causes a "FALSE" on the query leading to an empty queue. Perhaps it's better to throw an exception than. Returning zero jobs is confusing.

michalsn commented 5 months ago

MariaDB 10.6+ is required: https://queue.codeigniter.com/#requirements

Martin1877 commented 5 months ago

Yes, I've seen that. To throw an exception instead making the query false and then returning "no jobs found" is just something I missed :o= (I am working with the latest XAMPP for windows which covers MariaDB 10.4 only...)