this repo has no description
0
fork

Configure Feed

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

Make repo fetch timeout configurable

alice 419b20d0 df877a2d

+14 -1
+1
cmd/nexus/README.md
··· 60 60 - `NEXUS_FIREHOSE_PARALLELISM`: concurrent firehose event processors (default: `10`) 61 61 - `NEXUS_RESYNC_PARALLELISM`: concurrent resync workers (default: `5`) 62 62 - `NEXUS_CURSOR_SAVE_INTERVAL`: how often to save cursor (default: `5s`, set to `0` to disable) 63 + - `NEXUS_REPO_FETCH_TIMEOUT`: timeout for fetching repo CARs from PDS (Go duration syntax, e.g. `180s`) 63 64 - `NEXUS_FULL_NETWORK_MODE`: track all repos on the network (default: `false`) 64 65 - `NEXUS_SIGNAL_COLLECTION`: track all repos with at least one record in this collection (e.g. `app.bsky.actor.profile`) 65 66 - `NEXUS_COLLECTION_FILTERS`: comma-separated collection filters, wildcards accepted (e.g., `app.bsky.feed.post,app.bsky.graph.*`)
+7
cmd/nexus/main.go
··· 87 87 Value: 0, 88 88 EnvVars: []string{"NEXUS_CURSOR_SAVE_INTERVAL"}, 89 89 }, 90 + &cli.DurationFlag{ 91 + Name: "repo-fetch-timeout", 92 + Usage: "timeout when fetching repo CARs from PDS (e.g. 180s for slow hosts)", 93 + Value: 30 * time.Second, 94 + EnvVars: []string{"NEXUS_REPO_FETCH_TIMEOUT"}, 95 + }, 90 96 &cli.BoolFlag{ 91 97 Name: "full-network-mode", 92 98 Usage: "enumerate and sync all repos on the network", ··· 149 155 FirehoseParallelism: cctx.Int("firehose-parallelism"), 150 156 ResyncParallelism: cctx.Int("resync-parallelism"), 151 157 FirehoseCursorSaveInterval: cctx.Duration("cursor-save-interval"), 158 + RepoFetchTimeout: cctx.Duration("repo-fetch-timeout"), 152 159 FullNetworkMode: cctx.Bool("full-network-mode"), 153 160 SignalCollection: cctx.String("signal-collection"), 154 161 DisableAcks: cctx.Bool("disable-acks"),
+1
cmd/nexus/nexus.go
··· 49 49 FirehoseParallelism int 50 50 ResyncParallelism int 51 51 FirehoseCursorSaveInterval time.Duration 52 + RepoFetchTimeout time.Duration 52 53 FullNetworkMode bool 53 54 SignalCollection string 54 55 DisableAcks bool
+5 -1
cmd/nexus/resync.go
··· 119 119 n.logger.Info("fetching repo from PDS", "did", did, "pds", pdsURL) 120 120 121 121 client := atclient.NewAPIClient(pdsURL) 122 + timeout := n.config.RepoFetchTimeout 123 + if timeout <= 0 { 124 + timeout = 30 * time.Second 125 + } 122 126 client.Client = &http.Client{ 123 - Timeout: 30 * time.Second, 127 + Timeout: timeout, 124 128 } 125 129 126 130 repoBytes, err := comatproto.SyncGetRepo(ctx, client, did, "")