1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12683] Add progress bar to delete index

PHPBB3-12683
This commit is contained in:
rubencm
2021-03-24 19:25:03 +01:00
committed by Ruben Calvo
parent 75bdbcf4fe
commit c2f3ba44bd
4 changed files with 22 additions and 9 deletions

View File

@@ -329,7 +329,8 @@ abstract class base implements search_backend_interface
$starttime = microtime(true);
$row_count = 0;
while (still_on_time() && $post_counter <= $max_post_id)
$still_on_time = PHP_SAPI === 'cli' ? true : still_on_time();
while ($still_on_time && $post_counter <= $max_post_id)
{
$rows = $this->get_posts_batch_after($post_counter);
@@ -356,9 +357,6 @@ abstract class base implements search_backend_interface
}
}
// TODO: With cli if the previous bucle have stoped because of lack of time, launch an exception, because is an error
// cli commands should be executed in one step
// pretend the number of posts was as big as the number of ids we indexed so far
// just an estimation as it includes deleted posts
$num_posts = $this->config['num_posts'];