소스 검색

Fix transaction abort in Search\truncateIndex()

Visman 1 년 전
부모
커밋
48bcd118ad
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      app/Models/Search/TruncateIndex.php

+ 6 - 0
app/Models/Search/TruncateIndex.php

@@ -19,8 +19,14 @@ class TruncateIndex extends Method
      */
     public function truncateIndex(): void
     {
+        if ($this->c->DB->inTransaction()) {
+            $this->c->DB->commit();
+        }
+
         $this->c->DB->truncateTable('::search_cache');
         $this->c->DB->truncateTable('::search_matches');
         $this->c->DB->truncateTable('::search_words');
+
+        $this->c->DB->beginTransaction();
     }
 }