You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In its asynchronous send queue, BPGES attempts to determine the maximum sensible batch size by checking regularly for memory and time usage, and then ending a batch when 90% of either calculated maximum is reached. This is imperfect. In some hosting environments, it may not be possible to determine real memory use or the actual time/memory limits. And the 90% threshold assumes that the remaining 10% will be enough to complete execution, which will not necessarily be the case.
As such, there should be easy ways to reduce batch size. There are existing filters in place wp_bpges_send_queue_memory_exceeded etc that allow you to do this in certain ways. But the logic for doing so is hard, and in the case of time_exceeded there may not be enough information available in the filter callback to make an accurate calculation.
One or two new filters would be helpful here. I'm thinking two separate types of filters:
A batch_size filter. By default, it'd be null, which means that the value would be calculated on the fly, as is currently the case. If an integer is provided, it will be used in place of the memory/time checks.
A send_this_notification filter that would appear in the do loop. This would simply filter the value of $this->memory_exceeded() || $this->time_exceeded() (see eg
if ( $this->time_exceeded() || $this->memory_exceeded() ) {
) so that a plugin could do its own on-the-fly determination of whether to continue, without using a workaround related to the existing memory_exceeded and time_exceeded filters.
The text was updated successfully, but these errors were encountered:
Related: #163
In its asynchronous send queue, BPGES attempts to determine the maximum sensible batch size by checking regularly for memory and time usage, and then ending a batch when 90% of either calculated maximum is reached. This is imperfect. In some hosting environments, it may not be possible to determine real memory use or the actual time/memory limits. And the 90% threshold assumes that the remaining 10% will be enough to complete execution, which will not necessarily be the case.
As such, there should be easy ways to reduce batch size. There are existing filters in place
wp_bpges_send_queue_memory_exceeded
etc that allow you to do this in certain ways. But the logic for doing so is hard, and in the case oftime_exceeded
there may not be enough information available in the filter callback to make an accurate calculation.One or two new filters would be helpful here. I'm thinking two separate types of filters:
batch_size
filter. By default, it'd benull
, which means that the value would be calculated on the fly, as is currently the case. If an integer is provided, it will be used in place of the memory/time checks.send_this_notification
filter that would appear in thedo
loop. This would simply filter the value of$this->memory_exceeded() || $this->time_exceeded()
(see egbuddypress-group-email-subscription/classes/class-bpges-async-request-send-queue.php
Line 180 in fa241d5
memory_exceeded
andtime_exceeded
filters.The text was updated successfully, but these errors were encountered: