feat: change FilterParentRangeLimit validation (#1752)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2022-10-13 10:38:05 +08:00
parent bbd418542e
commit 61a6e545e5
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
3 changed files with 4 additions and 3 deletions

View File

@ -55,7 +55,7 @@ type GetSchedulerClustersQuery struct {
type SchedulerClusterConfig struct {
FilterParentLimit uint32 `yaml:"filterParentLimit" mapstructure:"filterParentLimit" json:"filter_parent_limit" binding:"omitempty,gte=1,lte=100"`
FilterParentRangeLimit uint32 `yaml:"filterParentRangeLimit" mapstructure:"filterParentRangeLimit" json:"filter_parent_range_limit" binding:"omitempty,gte=1,lte=1000"`
FilterParentRangeLimit uint32 `yaml:"filterParentRangeLimit" mapstructure:"filterParentRangeLimit" json:"filter_parent_range_limit" binding:"omitempty,gte=10,lte=1000"`
}
type SchedulerClusterClientConfig struct {

View File

@ -44,7 +44,7 @@ func New(service *service.Service, opts ...grpc.ServerOption) *grpc.Server {
// RegisterPeerTask registers peer and triggers seed peer download task.
func (s *Server) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error) {
// FIXME: Scheudler will not generate task id.
// FIXME Scheudler will not generate task id.
if req.TaskId == "" {
req.TaskId = idgen.TaskID(req.Url, req.UrlMeta)
}

View File

@ -571,7 +571,8 @@ func (s *Service) registerTask(ctx context.Context, req *schedulerv1.PeerTaskReq
return task, true, nil
}
// Start trigger seed peer task.
// FIXME Need to add the condition that the seed peer grpc client is
// available and can be triggered back-to-source.
if s.config.SeedPeer.Enable {
if task.IsSeedPeerFailed() {
return task, true, nil