Skip to content

Commit

Permalink
Merge pull request #3765 from pknap/fix/3764-move-offset-reset-before…
Browse files Browse the repository at this point in the history
…-message-output-in-indexer-cleanup

moved index offset reset before message output in indexer cleanup process
  • Loading branch information
felipeelia authored Nov 29, 2023
2 parents 3a9d13b + e40d73b commit f243586
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions includes/classes/IndexHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ protected function index_cleanup() {
$current_sync_item = $this->index_meta['current_sync_item'];

$this->index_meta['current_sync_item'] = null;
$this->index_meta['offset'] = 0;

if ( $current_sync_item['failed'] ) {
if ( ! empty( $current_sync_item['blog_id'] ) && defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
Expand All @@ -844,8 +845,6 @@ protected function index_cleanup() {
$this->output( $message, 'warning' );
}

$this->index_meta['offset'] = 0;

if ( ! empty( $current_sync_item['blog_id'] ) && defined( 'EP_IS_NETWORK' ) && EP_IS_NETWORK ) {
$message = sprintf(
/* translators: 1: indexable (plural), 2: Blog ID, 3: number of synced objects */
Expand Down

0 comments on commit f243586

Please sign in to comment.