| @@ 214-222 (lines=9) @@ | ||
| 211 | $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); |
|
| 212 | ||
| 213 | // If we hit our row limit, process and return. |
|
| 214 | if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { |
|
| 215 | $remaining_items_count = $max_items_to_enqueue - $chunk_count; |
|
| 216 | $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); |
|
| 217 | $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); |
|
| 218 | $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); |
|
| 219 | ||
| 220 | $last_chunk = end( $remaining_items ); |
|
| 221 | return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); |
|
| 222 | } |
|
| 223 | $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); |
|
| 224 | ||
| 225 | $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); |
|
| @@ 81-89 (lines=9) @@ | ||
| 78 | $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); |
|
| 79 | ||
| 80 | // If we hit our row limit, process and return. |
|
| 81 | if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { |
|
| 82 | $remaining_items_count = $max_items_to_enqueue - $chunk_count; |
|
| 83 | $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); |
|
| 84 | $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); |
|
| 85 | $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); |
|
| 86 | ||
| 87 | $last_chunk = end( $remaining_items ); |
|
| 88 | return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); |
|
| 89 | } |
|
| 90 | $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); |
|
| 91 | ||
| 92 | $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); |
|