Skip to content

Commit

Permalink
shorten code
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Apr 6, 2024
1 parent 9139a3c commit f85760a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/concurrency/resource-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,11 @@ export class ResourcePool<T> {
// TODO: implement timeout
const v = await this._borrow();

// console.log('borrowed', v);

const _return = lazyThenable(async () => {
this._return(v);
// console.log('returned', v);
});
const _return = lazyThenable(() => this._return(v));

return {
value: v,
dispose(): PromiseLike<void> {
async dispose(): Promise<void> {
return _return;

Check warning on line 97 in src/concurrency/resource-pool.ts

View check run for this annotation

Codecov / codecov/patch

src/concurrency/resource-pool.ts#L96-L97

Added lines #L96 - L97 were not covered by tests
},
[Symbol.asyncDispose]() {
Expand Down

0 comments on commit f85760a

Please sign in to comment.