Verified Commit 21b98592 authored by Erick Hitter's avatar Erick Hitter
Browse files

Simplify logic around event reorganization loop

parent 972f5410
......@@ -144,12 +144,7 @@ class Events extends Singleton {
$i = 1; // Intentionally not zero-indexed to facilitate comparisons against $action_counts members
while ( count( $reduced_queue ) < JOB_QUEUE_SIZE && ! empty( $events ) ) {
// Circuit breaker
if ( $i > 15 ) {
break;
}
while ( $i <= 15 && count( $reduced_queue ) < JOB_QUEUE_SIZE && ! empty( $events ) ) {
// Each time the events array is iterated over, move one instance of an action to the current queue
foreach ( $events as $key => $event ) {
$action = $event['action'];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment