Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mailgun/mailgun-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.11.0
Choose a base ref
...
head repository: mailgun/mailgun-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.11.1
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 20, 2023

  1. Fix leaking ticker

    SamuelSarle committed Sep 20, 2023
    Copy the full SHA
    ba99848 View commit details

Commits on Nov 6, 2023

  1. Merge pull request #313 from SamuelSarle/master

    Fix resource leak from time.NewTicker
    thrawn01 authored Nov 6, 2023
    Copy the full SHA
    d9eae83 View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 events.go
6 changes: 3 additions & 3 deletions events.go
Original file line number Diff line number Diff line change
@@ -277,12 +277,12 @@ func (ep *EventPoller) Poll(ctx context.Context, events *[]Event) bool {
ep.it.Paging.Next = currentPage

// Sleep the rest of our duration
tick := time.NewTicker(ep.opts.PollInterval)
timer := time.NewTimer(ep.opts.PollInterval)
select {
case <-ctx.Done():
timer.Stop()
return false
case <-tick.C:
tick.Stop()
case <-timer.C:
}
}