diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 0cf819bc..ed32fe32 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -35,8 +35,8 @@ class Kernel extends ConsoleKernel $schedule->command('claim:settle')->hourly()->when(function () { return Carbon::now()->format('d') == '01'; })->withoutOverlapping(); + $schedule->command('meilisearch:import')->weeklyOn(1, "03:00")->withoutOverlapping(); -// $schedule->command('plugin:cronjob')->everyMinute()->withoutOverlapping(); } /** diff --git a/app/Repositories/MeiliSearchRepository.php b/app/Repositories/MeiliSearchRepository.php index 57264fe5..3b5c60f9 100644 --- a/app/Repositories/MeiliSearchRepository.php +++ b/app/Repositories/MeiliSearchRepository.php @@ -113,7 +113,7 @@ class MeiliSearchRepository extends BaseRepository $swapResult = $client->swapIndexes([[self::INDEX_NAME, $indexName]]); $times = 0; while (true) { - if ($times == 600) { + if ($times == 3600) { $msg = "total: $total, swap too long, times: $times, return false"; do_log($msg); throw new NexusException($msg); diff --git a/include/cleanup.php b/include/cleanup.php index e388f3f8..335b98fd 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -958,16 +958,17 @@ function docleanup($forceAll = 0, $printProgress = false) { printProgress($log); } + //cost too many time, migrate to schedule run command //sync to Meilisearch - $meiliRep = new \App\Repositories\MeiliSearchRepository(); - if ($meiliRep->isEnabled()) { - $meiliRep->import(); - } - $log = "sync to Meilisearch"; - do_log($log); - if ($printProgress) { - printProgress($log); - } +// $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'");