mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:11:49 +00:00
We use the `neelance/parallel` package for two things right now: 1) a semaphore 2) a waitgroup/errgroup It makes for a more-complex-than-necessary semaphore, and a non-standard errgroup. We use it along with the `goroutine` package to log panics, but most of the time, logging a panic is not really what we want. This change was inspired by me getting confused by panics being swallowed in tests. This replaces uses of the package with a combination of `sourcegraph/conc` and a new `internal/limiter`. The new `internal/limiter` package is a very simple channel-based semaphore, and I merged in the `internal/mutablelimiter` package so now we have `limiter.New(n)` and `limiter.NewMutable(n)`. `sourcegraph/conc` replaces the combination of `goroutine.Go()` and `run.Acquire()`/`run.Release()` along with error collection and cancellation in some cases. Additionally, it propagates panics rather than just logging and ignoring them, which is often not good behavior.
2 lines
17 B
Plaintext
2 lines
17 B
Plaintext
** @keegancsmith
|