chore: clean up some comments and CI yaml (#296)

This commit is contained in:
Andy Pan 2023-09-18 22:37:02 +08:00 committed by GitHub
parent aee9c2e2da
commit 45bc4f51ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -92,7 +92,7 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.go }}-go-ci
- name: Run unit tests
- name: Run unit tests and integrated tests
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic
- name: Upload code coverage report to Codecov

View File

@ -106,8 +106,8 @@ func (p *Pool) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}
// There might be a situation where all workers have been cleaned up(no worker is running),
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
// There might be a situation where all workers have been cleaned up (no worker is running),
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
@ -207,8 +207,6 @@ func NewPool(size int, options ...Option) (*Pool, error) {
return p, nil
}
// ---------------------------------------------------------------------------
// Submit submits a task to this pool.
//
// Note that you are allowed to call Pool.Submit() from the current Pool.Submit(),
@ -321,8 +319,6 @@ func (p *Pool) Reboot() {
}
}
// ---------------------------------------------------------------------------
func (p *Pool) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}

View File

@ -107,8 +107,8 @@ func (p *PoolWithFunc) purgeStaleWorkers(ctx context.Context) {
staleWorkers[i] = nil
}
// There might be a situation where all workers have been cleaned up(no worker is running),
// while some invokers still are stuck in "p.cond.Wait()", then we need to awake those invokers.
// There might be a situation where all workers have been cleaned up (no worker is running),
// while some invokers still are stuck in p.cond.Wait(), then we need to awake those invokers.
if isDormant && p.Waiting() > 0 {
p.cond.Broadcast()
}
@ -213,8 +213,6 @@ func NewPoolWithFunc(size int, pf func(interface{}), options ...Option) (*PoolWi
return p, nil
}
//---------------------------------------------------------------------------
// Invoke submits a task to pool.
//
// Note that you are allowed to call Pool.Invoke() from the current Pool.Invoke(),
@ -327,8 +325,6 @@ func (p *PoolWithFunc) Reboot() {
}
}
//---------------------------------------------------------------------------
func (p *PoolWithFunc) addRunning(delta int) {
atomic.AddInt32(&p.running, int32(delta))
}