Skip to content

Commit b337c87

Browse files
committed
fix: catch errors in model fetch during migration
the cache is cleared by the function so our job is done here. when an api key would be set/changed, it would fetch the models again anyway. Signed-off-by: Anupam Kumar <[email protected]>
1 parent 4892cbc commit b337c87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Migration/Version030900Date20251006152735.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function __construct(
2929
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
3030
// we refresh the model list to make sure they are stored in oc_appconfig
3131
// so they are available immediately after the app upgrade to populate the task types enum values
32-
$this->openAIAPIService->getModels(null, true);
32+
try {
33+
$this->openAIAPIService->getModels(null, true);
34+
} catch (\Exception) {
35+
}
3336
}
3437
}

0 commit comments

Comments
 (0)