double check on release time leads to cron job failures
The check for the number of items in the queue looks for items with: release_time <= NOW()
In my database, SELECT NOW()
returns a date in UTC time.
The claim item code also uses this approach.
But, a few lines below, we redundantly check the release time date against the current time but for this check we use CRM_Utils_Time::time();
which returns the time using the site's configured time zone.
Since these times are different, I have a case where the Queue manager always says there's an item in the queue (since the sql condition is met) but then never returns it (because the PHP condition is not met). It seems that we could drop the PHP condition without any negative consequences and avoid this possible problem?