Feature request - Queue api should respect maintenance mode
Proposal to add a maintenance mode setting that is respected by the Queue api such that it would not permit claimItems
while this setting is enabled - except for possibly upgrade tasks?
Note that when coworker respects this it should log a message with a priority of warning
so that a sysadmin can see that although the process is running no tasks are.
Chat discussion to date https://chat.civicrm.org/civicrm/pl/9h93yabz33g17qa3apcet8irdy
The summary of the chat is that claimItem
api should be the place where maintenance mode is checked & heeded. This would be for 'persistent queues' - ie CRM_Queue_Queue_Memory
would not check it.
-
The claim item/s functions should call a symfony listener - returning false in this piece of code if an external listener (threshold check) sets the status to false -
we should add a setting for Maintenance mode (keep it simple) - call it queue_maintenance_mode
? ClaimItem should return FALSE if this is TRUE
Notes
- the following query will determine whether all queues have finished once maintenance mode is enabled:
SELECT * FROM civicrm_queue_item where release_time > NOW()
If future scheduling is in use (civi-rules?) then this might not suffice and if that ever arises as a feature someone wants to work on they could add a suitable field to the civicrm_queue_item
table (is_future_scheduled
?)
- I can't recall what we decided re should claimItems support an override - ie if you took everything else down in order to keep one queue running & want that queue to still claim items.... perhaps I'll find it