fix: KI-Backend brach lange Anfragen durch PHP-Timeout ab
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
ai_backend_call_and_charge (db.php) hob PHPs eigenes max_execution_time
nie an, obwohl AnthropicProvider dem curl-Aufruf bis zu 180s erlaubt.
Auf vielen Hosts liegt PHPs Default bei nur 30s - sobald ein Aufruf
laenger brauchte, killte PHP das Skript mitten in curl_exec() mit einem
unabfangbaren Fatal Error statt einer sauberen {"error": "..."}-Antwort.
Der Desktop-Client zeigte dadurch nur die pauschale Fallback-Meldung
ohne Grund - sah wie ein kompletter Ausfall der Einzelstunden-KI-Planung
aus, war aber ein request-Dauer-abhaengiger Timeout, der jeden der fuenf
ai_backend_call_and_charge-Endpunkte treffen konnte.
Fix zentral in ai_backend_call_and_charge (set_time_limit(200)) statt in
jedem Endpunkt einzeln - nach Deployment vom Nutzer verifiziert. Zusaetzlich
dauerhaftes Diagnose-Logging in AiPlanningService (Statuscode/Dauer/
Antwort-Body bei Fehlern ohne auswertbaren Grund) fuer kuenftige Faelle.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f0c0479bcb
commit
30f0fee0b2
6 files changed
+63
-9
No files matched your search
@@ -18,7 +18,7 @@ public sealed class AiPlanningServiceTests
|
||||
FakeCompetencyDomains competencyDomains, FakeAlternativeLessonPaths altPaths,
|
||||
FakeCompetencyCatalogVersions? competencyVersions = null) =>
|
||||
new(new HttpClient(), lessons, groups, subjects, competencyDomains,
|
||||
competencyVersions ?? new FakeCompetencyCatalogVersions(), altPaths);
|
||||
competencyVersions ?? new FakeCompetencyCatalogVersions(), altPaths, TestSupport.BuildAppLogger());
|
||||
|
||||
[Fact]
|
||||
public void ParsePlanningLessons_AkzeptiertNormaleAntwortUndDeutschesDatum()
|
||||
@@ -92,7 +92,8 @@ public sealed class AiPlanningServiceTests
|
||||
BaseAddress = new Uri("https://example.invalid/"),
|
||||
};
|
||||
var service = new AiPlanningService(http, new FakeLessons(), new FakeGroups([]), new FakeSubjects([]),
|
||||
new FakeCompetencyDomains(), new FakeCompetencyCatalogVersions(), new FakeAlternativeLessonPaths([]));
|
||||
new FakeCompetencyDomains(), new FakeCompetencyCatalogVersions(), new FakeAlternativeLessonPaths([]),
|
||||
TestSupport.BuildAppLogger());
|
||||
|
||||
var error = await Assert.ThrowsAsync<AiBackendException>(() =>
|
||||
service.RequestPlanAsync(new Unit(), "", "token"));
|
||||
@@ -191,7 +192,8 @@ public sealed class AiPlanningServiceTests
|
||||
BaseAddress = new Uri("https://example.invalid/"),
|
||||
};
|
||||
return new AiPlanningService(http, new FakeLessons(), new FakeGroups([]), new FakeSubjects([]),
|
||||
new FakeCompetencyDomains(), new FakeCompetencyCatalogVersions(), new FakeAlternativeLessonPaths([]));
|
||||
new FakeCompetencyDomains(), new FakeCompetencyCatalogVersions(), new FakeAlternativeLessonPaths([]),
|
||||
TestSupport.BuildAppLogger());
|
||||
}
|
||||
|
||||
private sealed class StaticResponseHandler(HttpStatusCode status, string body) : HttpMessageHandler
|
||||
|
||||
Reference in new issue
Block a user