mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Simplify db:populate:nip05 script
This commit is contained in:
parent
a4a26d7575
commit
b0dc7faaff
1 changed files with 17 additions and 17 deletions
|
|
@ -11,7 +11,6 @@ for await (const msg of store.req([{ kinds: [0] }])) {
|
|||
const signal = AbortSignal.timeout(30_000); // generous timeout
|
||||
const event = msg[2];
|
||||
|
||||
try {
|
||||
// Parse metadata.
|
||||
const metadata = n.json().pipe(n.metadata()).catch({}).safeParse(event.content);
|
||||
if (!metadata.success) continue;
|
||||
|
|
@ -29,10 +28,11 @@ for await (const msg of store.req([{ kinds: [0] }])) {
|
|||
// Update favicon.
|
||||
const domain = nip05?.split('@')[1].toLowerCase();
|
||||
if (domain) {
|
||||
try {
|
||||
await faviconCache.fetch(domain, { signal });
|
||||
}
|
||||
} catch {
|
||||
continue;
|
||||
// Ignore.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue