Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
8f9b27dc
Commit
8f9b27dc
authored
Feb 24, 2017
by
Erick Hitter
Browse files
Review feedback: loop improvements
parent
b8e3fd23
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/class-events-store.php
View file @
8f9b27dc
...
...
@@ -141,7 +141,7 @@ class Events_Store extends Singleton {
$jobs_posts
=
$this
->
get_jobs
(
array
(
'status'
=>
self
::
STATUS_PENDING
,
'quantity'
=>
$quantity
,
'page'
=>
$page
,
'page'
=>
$page
++
,
)
);
// Nothing more to add
...
...
@@ -149,8 +149,6 @@ class Events_Store extends Singleton {
break
;
}
$page
++
;
// Something's probably wrong if a site has more than 1,500 pending cron actions
if
(
$page
>
15
)
{
do_action
(
'a8c_cron_control_stopped_runaway_cron_option_rebuild'
);
...
...
@@ -184,13 +182,8 @@ class Events_Store extends Singleton {
$cron_array
[
$timestamp
][
$action
][
$instance
][
'interval'
]
=
$jobs_post
->
interval
;
}
}
// No need to keep looping if there were fewer events than we asked for
if
(
count
(
$jobs_posts
)
<
$quantity
)
{
break
;
}
}
}
while
(
true
);
}
while
(
count
(
$jobs_posts
)
>=
$quantity
);
// Re-sort the array just as Core does when events are scheduled
// Ensures events are sorted chronologically
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment