Skip to content

Commit 1a071cd

Browse files
committed
fix: fixed Every not stopping
1 parent 1bb9f28 commit 1a071cd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

schedule.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ func (s *Task) Wait() {
4646

4747
// Stop stops the scheduler.
4848
func (s *Task) Stop() {
49-
if !s.stopped {
50-
close(s.stop)
49+
if s.stopped {
50+
return
5151
}
5252

5353
s.stopped = true
54+
close(s.stop)
5455
}
5556

5657
// After executes the task after the given duration.

0 commit comments

Comments
 (0)