Lower the priority of the full volume synchronization meilisearch

This commit is contained in:
xiaomlove
2023-05-14 14:56:22 +08:00
parent cc584b4f19
commit b9eb7080ce
2 changed files with 11 additions and 31 deletions
+10 -30
View File
@@ -558,17 +558,6 @@ function docleanup($forceAll = 0, $printProgress = false) {
printProgress($log); printProgress($log);
} }
//sync to Meilisearch
$meiliRep = new \App\Repositories\MeiliSearchRepository();
if ($meiliRep->isEnabled()) {
$meiliRep->import();
}
$log = "sync to Meilisearch";
do_log($log);
if ($printProgress) {
printProgress($log);
}
//Priority Class 4: cleanup every 24 hours //Priority Class 4: cleanup every 24 hours
$res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime4'"); $res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime4'");
@@ -969,25 +958,16 @@ function docleanup($forceAll = 0, $printProgress = false) {
printProgress($log); printProgress($log);
} }
//delete duplicated snatched //sync to Meilisearch
//is it necessary ? duplicate snatch update by torrent_id + userid, all records key fields are the same $meiliRep = new \App\Repositories\MeiliSearchRepository();
// $snatchRes = sql_query('select userid, torrentid, group_concat(id) as ids from snatched group by userid, torrentid having(count(*)) > 1'); if ($meiliRep->isEnabled()) {
// while ($snatchRow = mysql_fetch_assoc($snatchRes)) { $meiliRep->import();
// $torrentId = $snatchRow['torrentid']; }
// $userId = $snatchRow['userid']; $log = "sync to Meilisearch";
// $idArr = explode(',', $snatchRow['ids']); do_log($log);
// sort($idArr, SORT_NUMERIC); if ($printProgress) {
// $remainId = array_pop($idArr); printProgress($log);
// $delIdStr = implode(',', $idArr); }
// do_log("[DELETE_DUPLICATED_SNATCH], torrent: $torrentId, user: $userId, snatchIdStr: $delIdStr");
// sql_query("delete from snatched where id in ($delIdStr)");
// sql_query("update claims set snatched_id = $remainId where torrent_id = $torrentId and uid = $userId");
// }
// $log = "delete duplicated snatched";
// do_log($log);
// if ($printProgress) {
// printProgress($log);
// }
//Priority Class 5: cleanup every 15 days //Priority Class 5: cleanup every 15 days
$res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime5'"); $res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime5'");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.3'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.3');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-05-13'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-05-14');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");