Skip to content

Commit

Permalink
move rebuild worker to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanashi committed Aug 8, 2024
1 parent 1edb0bd commit 00d692d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions files/lib/bootstrap/dev.tkirch.wsc.faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
use wcf\acp\page\FaqCategoryListPage;
use wcf\acp\page\FaqQuestionListPage;
use wcf\event\acp\menu\item\ItemCollecting;
use wcf\event\worker\RebuildWorkerCollecting;
use wcf\system\event\EventHandler;
use wcf\system\menu\acp\AcpMenuItem;
use wcf\system\request\LinkHandler;
use wcf\system\style\FontAwesomeIcon;
use wcf\system\WCF;
use wcf\system\worker\FaqQuestionSearchIndexRebuildDataWorker;

return static function (): void {
EventHandler::getInstance()->register(ItemCollecting::class, static function (ItemCollecting $event) {
Expand Down Expand Up @@ -67,4 +69,11 @@
}
}
});

EventHandler::getInstance()->register(
RebuildWorkerCollecting::class,
static function (RebuildWorkerCollecting $event) {
$event->register(FaqQuestionSearchIndexRebuildDataWorker::class, 200);
}
);
};
9 changes: 4 additions & 5 deletions objectType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
<classname>wcf\system\search\FaqQuestionSearch</classname>
<searchindex>wcf1_faq_questions_search_index</searchindex>
</type>
<type>
<name>dev.tkirch.wsc.faq.question.search.index</name>
</import>
<delete>
<type name="dev.tkirch.wsc.faq.question.search.index">
<definitionname>com.woltlab.wcf.rebuildData</definitionname>
<classname>wcf\system\worker\FaqQuestionSearchIndexRebuildDataWorker</classname>
<nicevalue>200</nicevalue>
</type>
</import>
</delete>
</data>
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
<instruction type="acpTemplate"/>
<instruction type="template"/>
<instruction type="acpMenu"/>
<instruction type="objectType"/>
</instructions>
</package>

0 comments on commit 00d692d

Please sign in to comment.