| @@ 237-245 (lines=9) @@ | ||
| 234 | $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); |
|
| 235 | ||
| 236 | // If we hit our row limit, process and return. |
|
| 237 | if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { |
|
| 238 | $remaining_items_count = $max_items_to_enqueue - $chunk_count; |
|
| 239 | $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); |
|
| 240 | $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); |
|
| 241 | $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); |
|
| 242 | ||
| 243 | $last_chunk = end( $remaining_items ); |
|
| 244 | return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); |
|
| 245 | } |
|
| 246 | $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); |
|
| 247 | ||
| 248 | $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); |
|
| @@ 103-111 (lines=9) @@ | ||
| 100 | $chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE ); |
|
| 101 | ||
| 102 | // If we hit our row limit, process and return. |
|
| 103 | if ( $chunk_count + count( $chunked_ids ) >= $max_items_to_enqueue ) { |
|
| 104 | $remaining_items_count = $max_items_to_enqueue - $chunk_count; |
|
| 105 | $remaining_items = array_slice( $chunked_ids, 0, $remaining_items_count ); |
|
| 106 | $remaining_items_with_previous_interval_end = $this->get_chunks_with_preceding_end( $remaining_items, $previous_interval_end ); |
|
| 107 | $listener->bulk_enqueue_full_sync_actions( $action_name, $remaining_items_with_previous_interval_end ); |
|
| 108 | ||
| 109 | $last_chunk = end( $remaining_items ); |
|
| 110 | return array( $remaining_items_count + $chunk_count, end( $last_chunk ) ); |
|
| 111 | } |
|
| 112 | $chunked_ids_with_previous_end = $this->get_chunks_with_preceding_end( $chunked_ids, $previous_interval_end ); |
|
| 113 | ||
| 114 | $listener->bulk_enqueue_full_sync_actions( $action_name, $chunked_ids_with_previous_end ); |
|