mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Create update_search_index.php
This commit is contained in:
parent
abcf0297a7
commit
74cfd90d60
1 changed files with 32 additions and 0 deletions
32
library/includes/cron/jobs/update_search_index.php
Normal file
32
library/includes/cron/jobs/update_search_index.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* TorrentPier – Bull-powered BitTorrent tracker engine
|
||||
*
|
||||
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
|
||||
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
|
||||
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||
*/
|
||||
|
||||
if (!defined('BB_ROOT')) {
|
||||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$offset = 0;
|
||||
$limit = 1000;
|
||||
$total_indexed = 0;
|
||||
|
||||
do {
|
||||
$indexed = index_data_to_manticore($limit, $offset);
|
||||
if ($indexed === false) {
|
||||
echo "Error during indexing at offset $offset\n";
|
||||
break;
|
||||
}
|
||||
|
||||
$total_indexed += $indexed;
|
||||
$offset += $limit;
|
||||
|
||||
echo "Indexed $indexed records, total: $total_indexed\n";
|
||||
usleep(100000); // 0.1 секунды
|
||||
} while ($indexed > 0);
|
||||
|
||||
echo "Indexing completed. Total records: $total_indexed\n";
|
Loading…
Add table
Add a link
Reference in a new issue