Skip to content

Commit

Permalink
cleanup redundant context
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Mashko committed Jun 26, 2024
1 parent b85aa8c commit 0eca1b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taskq.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (t *TaskQ) Enqueue(ctx context.Context, task Task) (int64, error) {
return id, nil
}

func (t *TaskQ) triggerFreeWorkers(ctx context.Context) {
func (t *TaskQ) triggerFreeWorkers() {
count := len(t.workers)
for i := 0; i < count; i++ {
if !t.triggerDequeue() {
Expand All @@ -142,7 +142,7 @@ func (t *TaskQ) Start() error {
if !atomic.CompareAndSwapInt32(&t.isRunning, 0, 1) {
return ErrStarted
}
t.triggerFreeWorkers(context.Background())
t.triggerFreeWorkers()
return nil
}

Expand All @@ -154,7 +154,7 @@ func (t *TaskQ) Shutdown(ctx context.Context) error {
if wait, _ := ctx.Value(ctxWaitKey{}).(bool); !wait {
atomic.StoreInt32(&t.isStopped, 1)
} else {
t.triggerFreeWorkers(ctx)
t.triggerFreeWorkers()
}

var pollDuration = time.Millisecond * 500
Expand Down

0 comments on commit 0eca1b3

Please sign in to comment.