Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Tidy code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Mar 11, 2024
1 parent 7c67a32 commit 24bee89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions algorithms.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package gubernator

import (
"context"
"time"

"github.com/mailgun/holster/v4/clock"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -480,7 +479,3 @@ func leakyBucketNewItem(ctx context.Context, s Store, c Cache, r *RateLimitReq)

return &rl, nil
}

func EpochMillis(t time.Time) int64 {
return t.UnixNano() / 1_000_000
}
5 changes: 5 additions & 0 deletions gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"strings"
"sync"
"time"

"github.com/mailgun/errors"
"github.com/mailgun/holster/v4/clock"
Expand Down Expand Up @@ -793,3 +794,7 @@ func isDeadlineExceeded(err error) bool {
}
return errors.Is(err, context.DeadlineExceeded)
}

func EpochMillis(t time.Time) int64 {
return t.UnixNano() / 1_000_000
}

0 comments on commit 24bee89

Please sign in to comment.