A locally focused bluesky appview

selective backfill

+11
README.md
··· 190 190 This takes a while on first load since its building everything. 191 191 After that, load the localhost url it gives you and it _should_ work. 192 192 193 + ## Selective Backfill 194 + 195 + If you'd like to backfill a particular repo, just hit the following endpoint: 196 + 197 + ``` 198 + curl http://localhost:4444/rescan/<DID OR HANDLE> 199 + 200 + ``` 201 + 202 + It will take a minute but it should pull all records from that user. 203 + 193 204 ## License 194 205 195 206 MIT (whyrusleeping)
+17
handlers.go
··· 26 26 e.Use(middleware.CORS()) 27 27 e.GET("/debug", s.handleGetDebugInfo) 28 28 e.GET("/reldids", s.handleGetRelevantDids) 29 + e.GET("/rescan/:did", s.handleRescanDid) 29 30 30 31 views := e.Group("/api") 31 32 views.GET("/me", s.handleGetMe) ··· 57 58 return e.JSON(200, map[string]any{ 58 59 "dids": s.backend.relevantDids, 59 60 }) 61 + } 62 + 63 + func (s *Server) handleRescanDid(e echo.Context) error { 64 + didparam := e.Param("did") 65 + 66 + ctx := e.Request().Context() 67 + did, err := s.resolveAccountIdent(ctx, didparam) 68 + if err != nil { 69 + return err 70 + } 71 + 72 + if err := s.rescanRepo(ctx, did); err != nil { 73 + return err 74 + } 75 + 76 + return e.JSON(200, map[string]any{"status": "ok"}) 60 77 } 61 78 62 79 func (s *Server) handleGetMe(e echo.Context) error {
+2
main.go
··· 365 365 return err 366 366 } 367 367 368 + s.backend.addRelevantDid(did) 369 + 368 370 c := &xrpclib.Client{ 369 371 Host: resp.PDSEndpoint(), 370 372 }
+6
pgbackend.go
··· 367 367 return false, nil 368 368 } 369 369 370 + func (b *PostgresBackend) addRelevantDid(did string) { 371 + b.rdLk.Lock() 372 + defer b.rdLk.Unlock() 373 + b.relevantDids[did] = true 374 + } 375 + 370 376 func (b *PostgresBackend) didIsRelevant(did string) bool { 371 377 b.rdLk.Lock() 372 378 defer b.rdLk.Unlock()