Modify the maximum number of tasks that can be queued before a delay is added to new actions (the default is 500).

apply_filters( 'pmpro_action_scheduler_queue_limit', 500 );

In Action Scheduler there are no in-built delays. If you don’t specify a time the action should run (or a schedule it should belong to) the action is added immediately to the queue and run ASAP. In PMPro, we add a delay if the number of items being added for a single group of actions exceeds the pmpro_action_scheduler_queue_limit.

This ensures that when a large number of items is added to the queue we begin to stagger those new tasks apart further out over time to smooth demand on your server’s resources.

The delay is only added if the number of actions in the queue for the group exceeds this limit, and the delay decreases as the queue gets smaller.

In practice you likely don’t need to modify this, but in some circumstances may decide you don’t need a limit, or want to modify it for better performance.

Lowering the limit threshold means more delay and less server use, while raising the limit means less delay and more server use. Passing a high number (like 99999) will essentially disable the queue delay limit altogether.

Parameters

$queue_limit
int; The default maximum number of async tasks allowed in the queue.

Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/classes/class-pmpro-action-scheduler.php

View in Source Code

About Actions and Filters in PMPro

Hooks allow you to extend Paid Memberships Pro without editing any core plugin files. You can use a hook to program custom code that interacts with or modifies code in our plugin, Add Ons, your theme, and even WordPress itself.

There are two kinds of hooks: actions and filters.

  • Action hooks allow you to run new custom code at pre-defined locations.
  • Filter hooks allow you to change or extend existing code by modifying the data and returning it back to the software.

Click here to browse the full database of action and filter hooks available in Paid Memberships Pro. For help extending our Add Ons, refer to the individual Add On's documentation page for a list of available hooks.

For more developer-focused information about Paid Memberships Pro, check out the advanced developer topics documentation.

Was this article helpful?
YesNo