Ping and reconnect DB in fulltext sync for actors fulltext index

This commit is contained in:
2025-06-08 17:19:47 +02:00
parent 1051e10732
commit 25668b7b16
2 changed files with 14 additions and 2 deletions

View File

@ -11,7 +11,7 @@ declare(strict_types = 1);
*/
final class NodaPersinstFulltextSyncManticore {
const FULL_SYNC_COMMIT_AFTER = 30000;
private const FULL_SYNC_COMMIT_AFTER = 30000;
/**
* Returns all names and descriptions in the different languages of a actor.
@ -188,6 +188,10 @@ final class NodaPersinstFulltextSyncManticore {
$mysqli_manticore->commit();
if (PHP_SAPI === 'cli' && $mysqli_noda->ping() === false) {
$mysqli_noda->reconnect();
}
// Sync translations
$result = $mysqli_noda->do_read_query("SELECT `persinst`.`persinst_id`, `trans_language`,

View File

@ -11,7 +11,7 @@ declare(strict_types = 1);
*/
final class NodaTagFulltextSyncManticore {
const FULL_SYNC_COMMIT_AFTER = 30000;
private const FULL_SYNC_COMMIT_AFTER = 30000;
/**
* Returns all names and descriptions in the different languages of a tag.
@ -139,6 +139,10 @@ final class NodaTagFulltextSyncManticore {
/**
* Synchronizes base entries.
*
* @param MDMysqli $mysqli_noda Connection to MySQL DB.
* @param MDMysqli $mysqli_manticore Connection to Manticore DB.
* @param string $databasename Name of the main noda database.
*
* @return void
*/
public static function runFullSyncForBaseEntries(MDMysqli $mysqli_noda, MDMysqli $mysqli_manticore, string $databasename):void {
@ -189,6 +193,10 @@ final class NodaTagFulltextSyncManticore {
/**
* Synchronizes translated entries.
*
* @param MDMysqli $mysqli_noda Connection to MySQL DB.
* @param MDMysqli $mysqli_manticore Connection to Manticore DB.
* @param string $databasename Name of the main noda database.
*
* @return void
*/
public static function runFullSyncForTranslatedEntries(MDMysqli $mysqli_noda, MDMysqli $mysqli_manticore, string $databasename):void {