Skip to content

Commit

Permalink
add with limit
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Sep 29, 2023
1 parent 1ebbdd8 commit 865b396
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ func WithFakeClock(clock clockwork.Clock) SchedulerOption {
}
}

type LimitMode int

const (
LimitModeReschedule = 1
LimitModeWait = 2
)

func WithLimit(limit int, mode LimitMode) SchedulerOption {
return func(s *scheduler) error {
return nil
}
}

func WithLocation(location *time.Location) SchedulerOption {
return func(s *scheduler) error {
if location == nil {
Expand Down
2 changes: 1 addition & 1 deletion scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestScheduler_Start(t *testing.T) {
func TestScheduler_Cron_Start_Stop(t *testing.T) {
s, err := NewScheduler()
require.NoError(t, err)

Expand Down

0 comments on commit 865b396

Please sign in to comment.