feat: change FilterParentRangeLimit validation (#1752)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
bbd418542e
commit
61a6e545e5
|
|
@ -55,7 +55,7 @@ type GetSchedulerClustersQuery struct {
|
||||||
|
|
||||||
type SchedulerClusterConfig struct {
|
type SchedulerClusterConfig struct {
|
||||||
FilterParentLimit uint32 `yaml:"filterParentLimit" mapstructure:"filterParentLimit" json:"filter_parent_limit" binding:"omitempty,gte=1,lte=100"`
|
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 {
|
type SchedulerClusterClientConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ func New(service *service.Service, opts ...grpc.ServerOption) *grpc.Server {
|
||||||
|
|
||||||
// RegisterPeerTask registers peer and triggers seed peer download task.
|
// RegisterPeerTask registers peer and triggers seed peer download task.
|
||||||
func (s *Server) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error) {
|
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 == "" {
|
if req.TaskId == "" {
|
||||||
req.TaskId = idgen.TaskID(req.Url, req.UrlMeta)
|
req.TaskId = idgen.TaskID(req.Url, req.UrlMeta)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -571,7 +571,8 @@ func (s *Service) registerTask(ctx context.Context, req *schedulerv1.PeerTaskReq
|
||||||
return task, true, nil
|
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 s.config.SeedPeer.Enable {
|
||||||
if task.IsSeedPeerFailed() {
|
if task.IsSeedPeerFailed() {
|
||||||
return task, true, nil
|
return task, true, nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue