修复全量测试竞态并更新审查夹具,保存证书覆盖调整前基线
This commit is contained in:
1 parent
78dfcde5e1
commit
2aac6dd9be
15 files changed
+146
-158
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// Package passwordcapacity 管理所有密码计算入口共享的并发名额。
|
||||
package passwordcapacity
|
||||
|
||||
import "errors"
|
||||
|
||||
var ErrBusy = errors.New("password computation is busy")
|
||||
|
||||
var computationSlot = make(chan struct{}, 1)
|
||||
|
||||
// Acquire 满载时立即拒绝,不积压等待请求;调用方必须延迟释放名额。
|
||||
func Acquire() (func(), error) {
|
||||
select {
|
||||
case computationSlot <- struct{}{}:
|
||||
return func() { <-computationSlot }, nil
|
||||
default:
|
||||
return nil, ErrBusy
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user