fix: resolve bugs 01 through 08 and set Ollama TTL to 1h
This commit is contained in:
1 parent
a01bf64445
commit
9bbc9473de
14 files changed
+366
-108
No files matched your search
@@ -492,13 +492,22 @@ export const api = {
|
||||
throw new Error(`Failed to get articles: ${resp.status}`);
|
||||
},
|
||||
async submitDebrief(payload) {
|
||||
const resp = await fetch('/api/lessons/debrief', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
if (resp.ok) return await resp.json();
|
||||
throw new Error(`Failed to submit debrief: ${resp.status}`);
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => controller.abort(), 12000);
|
||||
try {
|
||||
const resp = await fetch('/api/lessons/debrief', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
signal: controller.signal
|
||||
});
|
||||
clearTimeout(timeoutId);
|
||||
if (resp.ok) return await resp.json();
|
||||
throw new Error(`Failed to submit debrief: ${resp.status}`);
|
||||
} catch (err) {
|
||||
clearTimeout(timeoutId);
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
async getHistory(limit = 15) {
|
||||
const resp = await fetch(`/api/lessons/history?limit=${limit}`);
|
||||
|
||||
Reference in new issue
Block a user