(queueName string, clientFetchCooldown time.Duration, clientFetchPollInterval time.Duration)
| 645 | } |
| 646 | |
| 647 | func (c QueueConfig) validate(queueName string, clientFetchCooldown time.Duration, clientFetchPollInterval time.Duration) error { |
| 648 | if c.FetchCooldown < 0 { |
| 649 | return errors.New("FetchCooldown cannot be less than zero") |
| 650 | } |
| 651 | if c.FetchPollInterval < 0 { |
| 652 | return errors.New("FetchPollInterval cannot be less than zero") |
| 653 | } |
| 654 | |
| 655 | resolvedFetchCooldown := cmp.Or(c.FetchCooldown, clientFetchCooldown) |
| 656 | resolvedFetchPollInterval := cmp.Or(c.FetchPollInterval, clientFetchPollInterval) |
| 657 | if resolvedFetchPollInterval < resolvedFetchCooldown { |
| 658 | return errors.New("FetchPollInterval cannot be less than FetchCooldown") |
| 659 | } |
| 660 | |
| 661 | if c.MaxWorkers < 1 || c.MaxWorkers > QueueNumWorkersMax { |
| 662 | return fmt.Errorf("invalid number of workers for queue %q: %d", queueName, c.MaxWorkers) |
| 663 | } |
| 664 | if err := validateQueueName(queueName); err != nil { |
| 665 | return err |
| 666 | } |
| 667 | |
| 668 | return nil |
| 669 | } |
| 670 | |
| 671 | // Client is a single isolated instance of River. Your application may use |
| 672 | // multiple instances operating on different databases or Postgres schemas |
nothing calls this directly
no test coverage detected