fix(sqlite,browser): resolve SQLite connection pool deadlock, disable stale SW cache, and update BRAIN.md
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 38s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 38s
This commit is contained in:
1 parent
d6bc2976d9
commit
5c4e130862
8 files changed
+414
-231
No files matched your search
+16
-4
@@ -40,6 +40,7 @@ async function request<T>(path: string, options: RequestInit = {}, isRetry = fal
|
||||
const token = getToken();
|
||||
const headers: Record<string, string> = {
|
||||
'Content-Type': 'application/json',
|
||||
'Cache-Control': 'no-cache',
|
||||
...(options.headers as Record<string, string>),
|
||||
};
|
||||
|
||||
@@ -47,16 +48,27 @@ async function request<T>(path: string, options: RequestInit = {}, isRetry = fal
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
const res = await fetch(path, {
|
||||
...options,
|
||||
headers,
|
||||
});
|
||||
const controller = new AbortController();
|
||||
const timeoutId = window.setTimeout(() => controller.abort(), 8000);
|
||||
|
||||
let res: Response;
|
||||
try {
|
||||
res = await fetch(path, {
|
||||
...options,
|
||||
headers,
|
||||
cache: 'no-store',
|
||||
signal: controller.signal,
|
||||
});
|
||||
} finally {
|
||||
window.clearTimeout(timeoutId);
|
||||
}
|
||||
|
||||
if (res.status === 401 && !isRetry && !path.includes('/auth/login') && !path.includes('/auth/quickstart')) {
|
||||
try {
|
||||
const qsRes = await fetch('/api/v1/auth/quickstart', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
cache: 'no-store',
|
||||
});
|
||||
if (qsRes.ok) {
|
||||
const qsData = await qsRes.json();
|
||||
|
||||
Reference in new issue
Block a user