Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validation #1701

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update validation
  • Loading branch information
tonyhb committed Aug 28, 2024
commit 66416ed742aa2e9fb2daa9542bd053db1e9de34f
6 changes: 6 additions & 0 deletions pkg/inngest/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ func (f Function) Validate(ctx context.Context) error {
}
}

if f.Throttle != nil {
if f.Throttle.Period > consts.FunctionIdempotencyPeriod {
return fmt.Errorf("Throttle period must be less than %s", consts.FunctionIdempotencyPeriod)
}
}

return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/inngest/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (r RateLimit) IsValid(ctx context.Context) error {
return fmt.Errorf("failed to parse time duration: %w", err)
}
if dur > consts.FunctionIdempotencyPeriod {
return fmt.Errorf("period must be less than %s", consts.FunctionIdempotencyPeriod)
return fmt.Errorf("Rate limit period must be less than %s", consts.FunctionIdempotencyPeriod)
}

return nil
Expand Down
Loading