this repo has no description
13
fork

Configure Feed

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

small fixes

+10 -10
+10 -10
cmd/slinky/main.go
··· 65 65 } 66 66 67 67 // default logging to stderr 68 - h := slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug}) 68 + h := slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelInfo}) 69 69 slog.SetDefault(slog.New(h)) 70 70 71 71 if err := app.Run(context.Background(), os.Args); err != nil { ··· 74 74 } 75 75 } 76 76 77 - // XXX: error handling (errgroup?) 77 + // TODO: error handling (errgroup?) 78 78 func enumerateAccounts(cmd *cli.Command, collection syntax.NSID, tasks chan syntax.DID) error { 79 79 ctx := context.Background() 80 + slog.Info("enumerating accounts", "collection", collection) 80 81 defer close(tasks) 81 82 82 83 c := client.NewAPIClient(cmd.String("relay-host")) ··· 90 91 slog.Error("enumerating accounts", "host", c.Host, "cursor", cursor, "err", err) 91 92 return err 92 93 } 93 - if page.Cursor == nil || *page.Cursor == "" || *page.Cursor == cursor { 94 - break 95 - } 96 - cursor = *page.Cursor 97 94 98 95 for _, row := range page.Repos { 99 96 did, err := syntax.ParseDID(row.Did) ··· 103 100 } 104 101 tasks <- did 105 102 } 103 + 104 + if page.Cursor == nil || *page.Cursor == "" || *page.Cursor == cursor { 105 + break 106 + } 107 + cursor = *page.Cursor 106 108 } 107 109 return nil 108 110 } ··· 141 143 ctx := context.Background() 142 144 defer wg.Done() 143 145 for did := range tasks { 144 - // do work here 145 - fmt.Println(did) // XXX 146 - 147 146 var rec json.RawMessage 148 147 recCID, err := nc.GetRecord(ctx, did, collection, rkey, &rec) 149 148 if err != nil { ··· 212 211 continue 213 212 } 214 213 214 + // NOTE: much of this routine should be refactored in to a 'repo.WalkRecords()' method 215 215 err = repo.MST.Walk(func(key []byte, val cid.Cid) error { 216 216 wcoll, rkey, err := syntax.ParseRepoPath(string(key)) 217 217 if err != nil { ··· 239 239 } 240 240 241 241 var recRaw json.RawMessage 242 - if err := json.Unmarshal(recJSON, recRaw); err != nil { 242 + if err := json.Unmarshal(recJSON, &recRaw); err != nil { 243 243 return err 244 244 } 245 245