A Bluesky labeler that labels accounts hosted on PDSes operated by entities other than Bluesky PBC
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve error handling

gbl08ma b467f476 635b6509

+14 -10
+14 -10
labeler.ts
··· 224 224 for await (const uri of this.activeLabelsStorage.getActiveLabelSubjects()) { 225 225 const p = new Promise<void>((resolve) => { 226 226 this.scheduleTask(async () => { 227 - const did = uri as `did:${"plc" | "web"}:${string}`; 228 - const pds = await this.crawler.identifyPDSofDID(did, true); 229 - const maybeKnownPDS = await this.knownPDSStorage.getKnownPDS(pds); 227 + try { 228 + const did = uri as `did:${"plc" | "web"}:${string}`; 229 + const pds = await this.crawler.identifyPDSofDID(did, true); 230 + const maybeKnownPDS = await this.knownPDSStorage.getKnownPDS(pds); 230 231 231 - if (typeof maybeKnownPDS === "undefined") { 232 - console.log(`Crawling new PDS discovered when reprocessing labels for ${did}: ${pds}`); 233 - await this.processPDS(pds); 234 - } else { 235 - await this.processSingleDID(pds, did); 232 + if (typeof maybeKnownPDS === "undefined") { 233 + console.log(`Crawling new PDS discovered when reprocessing labels for ${did}: ${pds}`); 234 + await this.processPDS(pds); 235 + } else { 236 + await this.processSingleDID(pds, did); 237 + } 238 + totalProcessed++; 239 + } finally { 240 + // let's never block because processing one failed 241 + resolve(); 236 242 } 237 - totalProcessed++; 238 - resolve(); 239 243 }); 240 244 }); 241 245 // avoid having too many in-flight tasks at once