Skip to content

Commit

Permalink
Merge pull request #3418 from romainruaud/fix_indices-rebuilding-date…
Browse files Browse the repository at this point in the history
…-format

Fix #3403 DateTime constructor in IndexStatusProvider
  • Loading branch information
romainruaud authored Oct 22, 2024
2 parents 6694873 + e208790 commit 9578b31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/module-elasticsuite-indices/Model/IndexStatusProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ private function isRebuilding(string $indexName, $indexDate): bool
if (!empty($this->workingIndexers)) {
foreach (array_keys($this->workingIndexers) as $indexKey) {
if (strpos((string) $indexName, $indexKey) !== false) {
$today = new DateTime('Ymd');
$day = new DateTime($indexDate);
$today = new DateTime('now');

return ($today == $day);
return ($today->format('Y-m-d') === $indexDate->format('Y-m-d'));
}
}
}
Expand Down

0 comments on commit 9578b31

Please sign in to comment.