Commit 985cb22
authored
refactor: move deployment limiter into context (#1841)
#### What this PR does / Why we need it:
Removes the global variable and puts deployment options into the
context, to prevent prop-drilling
#### Special notes for your reviewer:
Coverage check may fail because of these two lines inside the `if`
```go
if options.ConcurrentDeploymentsLimiter != nil {
options.ConcurrentDeploymentsLimiter.Acquire()
defer options.ConcurrentDeploymentsLimiter.Release()
}
```
The question is: do we want to test that?
Add a test that just checks if acquire/release was called? how: replace
the limiter struct inside the options with an interface and put a stub
into the context, so that the call can be checked.
Should we write an integration test for it? how: stubbed clients that
don't respond and we check if upserts were called
{limitedConcurrentCount} times
#### Does this PR introduce a user-facing change?
No1 parent 984985b commit 985cb22
1 file changed
+19
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
75 | | - | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
292 | 304 | | |
293 | 305 | | |
294 | 306 | | |
295 | | - | |
296 | | - | |
297 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
298 | 310 | | |
299 | 311 | | |
300 | 312 | | |
| |||
0 commit comments