this repo has no description
0
fork

Configure Feed

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

make shard threshold parameter usable through admin api (#548)

currently this will always default to 20 when called (despite the
comment saying 50), which is better for our purposes than the 50 that
defaults in the background routine, but still should be something we can
set

authored by

Whyrusleeping and committed by
GitHub
9f8a1376 4b17ae1a

+19 -1
+11 -1
bgs/admin.go
··· 463 463 lim = v 464 464 } 465 465 466 - err := bgs.compactor.EnqueueAllRepos(ctx, bgs, lim, 0, fast) 466 + shardThresh := 20 467 + if threshstr := e.QueryParam("threshold"); threshstr != "" { 468 + v, err := strconv.Atoi(threshstr) 469 + if err != nil { 470 + return err 471 + } 472 + 473 + shardThresh = v 474 + } 475 + 476 + err := bgs.compactor.EnqueueAllRepos(ctx, bgs, lim, shardThresh, fast) 467 477 if err != nil { 468 478 return echo.NewHTTPError(http.StatusInternalServerError, fmt.Errorf("failed to enqueue all repos: %w", err)) 469 479 }
+8
cmd/gosky/bgs.go
··· 377 377 &cli.IntFlag{ 378 378 Name: "limit", 379 379 }, 380 + &cli.IntFlag{ 381 + Name: "threshold", 382 + }, 380 383 &cli.BoolFlag{ 381 384 Name: "fast", 382 385 }, ··· 399 402 if cctx.IsSet("limit") { 400 403 q.Add("limit", fmt.Sprint(cctx.Int("limit"))) 401 404 } 405 + 406 + if cctx.IsSet("threshold") { 407 + q.Add("threshold", fmt.Sprint(cctx.Int("threshold"))) 408 + } 409 + 402 410 uu.RawQuery = q.Encode() 403 411 404 412 req, err := http.NewRequest("POST", uu.String(), nil)