File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/Interfaces/Bootstrap/Facade Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ public function checkStatus(RequestInterface $request): array
5353 */
5454 public function execute (RequestInterface $ request ): array
5555 {
56+ $ this ->assertBootstrapPending ();
57+
5658 $ requestDTO = BootstrapExecuteRequestDTO::fromRequest ($ this ->request );
5759
5860 return $ this ->bootstrapInitializationAppService ->initialize ($ requestDTO );
@@ -77,7 +79,7 @@ public function llmConnectivityTest()
7779
7880 protected function assertBootstrapPending (): void
7981 {
80- if (! $ this ->magicSettingAppService -> get ()-> isNeedInitial ( )) {
82+ if (! ( $ this ->checkStatus ( $ this -> request )[ ' need_initial ' ] ?? false )) {
8183 ExceptionBuilder::throw (GenericErrorCode::IllegalOperation, 'bootstrap has already been initialized ' );
8284 }
8385 }
Original file line number Diff line number Diff line change @@ -139,7 +139,13 @@ private function createApi(
139139 RequestInterface $ request ,
140140 ?MagicSettingAppService $ magicSettingAppService = null
141141 ): BootstrapApi {
142- $ magicSettingAppService ??= $ this ->createMock (MagicSettingAppService::class);
142+ if ($ magicSettingAppService === null ) {
143+ $ magicSettingAppService = $ this ->createMock (MagicSettingAppService::class);
144+ $ globalConfig = new GlobalConfig ();
145+ $ globalConfig ->setNeedInitial (true );
146+ $ magicSettingAppService ->method ('getWithoutCache ' )->willReturn ($ globalConfig );
147+ }
148+
143149 return new BootstrapApi ($ request , $ magicSettingAppService );
144150 }
145151}
You can’t perform that action at this time.
0 commit comments