fix4
This commit is contained in:
1 parent
81342d834a
commit
1e921b4084
2 files changed
+20
-10
No files matched your search
@@ -17,15 +17,21 @@ export function useSystemStructures(visibleSystems: Set<string>) {
|
||||
if (missing.length === 0) return;
|
||||
let cancelled = false;
|
||||
|
||||
Promise.all(
|
||||
missing.map((slug) =>
|
||||
api.structures({ system: slug }).then((data) => [slug, data] as const),
|
||||
),
|
||||
).then((pairs) => {
|
||||
if (cancelled) return;
|
||||
for (const [slug, data] of pairs) cacheRef.current.set(slug, data);
|
||||
bump();
|
||||
});
|
||||
// Cada sistema atualiza o cache assim que a SUA própria resposta chega
|
||||
// — um sistema lento/travado (ex: um com muito mais estruturas) não
|
||||
// pode impedir os outros de aparecerem (Promise.all faria isso).
|
||||
for (const slug of missing) {
|
||||
api
|
||||
.structures({ system: slug })
|
||||
.then((data) => {
|
||||
if (cancelled) return;
|
||||
cacheRef.current.set(slug, data);
|
||||
bump();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(`Falha ao carregar estruturas de "${slug}":`, err);
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
|
||||
+5
-1
@@ -30,7 +30,11 @@ http {
|
||||
# worker sobe e cachear esse IP para sempre — sem isso, recriar o
|
||||
# container anatomia-api (rebuild, restart) muda o IP dele e o nginx
|
||||
# continua batendo no IP antigo até ser reiniciado manualmente.
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
# ipv6=off: a rede "dockernet" atribui IPv6 aos containers, mas o
|
||||
# caminho IPv6 entre eles parece sem rota nesse host (a conexão via
|
||||
# AAAA ora falha rápido com "Connection refused", ora fica pendurada
|
||||
# até estourar o timeout) — forçamos resolução só por IPv4 (A records).
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
location /api/ {
|
||||
set $api_upstream anatomia-api:3333;
|
||||
|
||||
Reference in new issue
Block a user