Skip to content

Commit eb60472

Browse files
authored
v0.4.1
2025-12-25
2 parents 0fc61f1 + 09e7705 commit eb60472

File tree

5 files changed

+346
-3
lines changed

5 files changed

+346
-3
lines changed

FUTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* [x] 回归 channel 实现
66
* [x] 增加资源可用性检查
7-
* [ ] 提高单元测试覆盖率到 80% 以上
7+
* [x] 提高单元测试覆盖率到 90% 以上
88

99
### v0.3.x
1010

HISTORY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## 📜 历史版本的特性介绍
22

3+
### v0.4.1
4+
5+
> 此版本发布于 2025-12-25
6+
7+
* 提高单元测试覆盖率到 100%
8+
* 早上 6 点起来去抽血和拍胸片,吃了药之后,现在好多了!!!
9+
310
### v0.4.0-alpha
411

512
> 此版本发布于 2025-12-25

_icons/coverage.svg

Lines changed: 2 additions & 2 deletions
Loading

pool.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ func (p *Pool[Resource]) Acquire(ctx context.Context) (resource Resource, err er
135135
p.lock.Lock()
136136
p.active--
137137
p.lock.Unlock()
138+
139+
if err = p.release(ctx, resource); err != nil {
140+
return resource, err
141+
}
142+
138143
continue
139144
}
140145

@@ -179,6 +184,11 @@ func (p *Pool[Resource]) Acquire(ctx context.Context) (resource Resource, err er
179184
p.lock.Lock()
180185
p.active--
181186
p.lock.Unlock()
187+
188+
if err = p.release(ctx, resource); err != nil {
189+
return resource, err
190+
}
191+
182192
continue
183193
}
184194
}

0 commit comments

Comments
 (0)