Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has_pending_actions_due() performance improvements #1077

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from
14 changes: 9 additions & 5 deletions classes/abstracts/ActionScheduler_Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,15 @@ public function get_status_labels() {
* @return string
*/
public function has_pending_actions_due() {
$pending_actions = $this->query_actions( array(
'date' => as_get_datetime_object(),
'status' => self::STATUS_PENDING,
'orderby' => 'none',
) );
$pending_actions = $this->query_actions(
array(
'per_page' => 1,
'date' => as_get_datetime_object(),
'status' => self::STATUS_PENDING,
'orderby' => 'none',
),
'count'
);

return ! empty( $pending_actions );
crstauf marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down
Loading