diff --git a/include/cleanup.php b/include/cleanup.php index 6b28ad0a..e388f3f8 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -558,17 +558,6 @@ function docleanup($forceAll = 0, $printProgress = false) { 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 $res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime4'"); @@ -969,25 +958,16 @@ function docleanup($forceAll = 0, $printProgress = false) { printProgress($log); } - //delete duplicated snatched - //is it necessary ? duplicate snatch update by torrent_id + userid, all records key fields are the same -// $snatchRes = sql_query('select userid, torrentid, group_concat(id) as ids from snatched group by userid, torrentid having(count(*)) > 1'); -// while ($snatchRow = mysql_fetch_assoc($snatchRes)) { -// $torrentId = $snatchRow['torrentid']; -// $userId = $snatchRow['userid']; -// $idArr = explode(',', $snatchRow['ids']); -// sort($idArr, SORT_NUMERIC); -// $remainId = array_pop($idArr); -// $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); -// } + //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 5: cleanup every 15 days $res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime5'"); diff --git a/include/constants.php b/include/constants.php index 62fe6632..3abc8e99 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@