From b0fb0513ea889e5540109afe6c97b5ca568fa532 Mon Sep 17 00:00:00 2001 From: lgb <353856593@qq.com> Date: Mon, 24 Jun 2024 14:51:47 +0800 Subject: [PATCH] meilisearch improt think about enabled --- app/Repositories/MeiliSearchRepository.php | 3 +++ include/constants.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Repositories/MeiliSearchRepository.php b/app/Repositories/MeiliSearchRepository.php index 3b5c60f9..83e7f0c9 100644 --- a/app/Repositories/MeiliSearchRepository.php +++ b/app/Repositories/MeiliSearchRepository.php @@ -96,6 +96,9 @@ class MeiliSearchRepository extends BaseRepository public function import() { + if (!$this->isEnabled()) { + return 0; + } $client = $this->getClient(); $stats = $client->stats(); if (isset($stats['indexes'][self::INDEX_NAME])) { diff --git a/include/constants.php b/include/constants.php index 37608b46..e41a3150 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@