@@ -470,6 +470,13 @@ func (s *managerServerV2) UpdateScheduler(ctx context.Context, req *managerv2.Up
470
470
schedulerFeatures = req .GetFeatures ()
471
471
}
472
472
473
+ var schedulerConfig models.JSONMap
474
+ if len (req .Config ) > 0 {
475
+ if err := json .Unmarshal (req .Config , & schedulerConfig ); err != nil {
476
+ return nil , status .Error (codes .Internal , err .Error ())
477
+ }
478
+ }
479
+
473
480
if err := s .db .WithContext (ctx ).Model (& scheduler ).Updates (models.Scheduler {
474
481
IDC : req .GetIdc (),
475
482
Location : req .GetLocation (),
@@ -478,6 +485,7 @@ func (s *managerServerV2) UpdateScheduler(ctx context.Context, req *managerv2.Up
478
485
SchedulerClusterID : uint (req .GetSchedulerClusterId ()),
479
486
Features : schedulerFeatures ,
480
487
LastKeepAliveAt : time .Now (),
488
+ Config : schedulerConfig ,
481
489
}).Error ; err != nil {
482
490
return nil , status .Error (codes .Internal , err .Error ())
483
491
}
@@ -516,6 +524,13 @@ func (s *managerServerV2) createScheduler(ctx context.Context, req *managerv2.Up
516
524
schedulerFeatures = req .GetFeatures ()
517
525
}
518
526
527
+ var schedulerConfig models.JSONMap
528
+ if len (req .Config ) > 0 {
529
+ if err := json .Unmarshal (req .Config , & schedulerConfig ); err != nil {
530
+ return nil , status .Error (codes .Internal , err .Error ())
531
+ }
532
+ }
533
+
519
534
scheduler := models.Scheduler {
520
535
Hostname : req .GetHostname (),
521
536
IDC : req .GetIdc (),
@@ -525,6 +540,7 @@ func (s *managerServerV2) createScheduler(ctx context.Context, req *managerv2.Up
525
540
Features : schedulerFeatures ,
526
541
SchedulerClusterID : uint (req .GetSchedulerClusterId ()),
527
542
LastKeepAliveAt : time .Now (),
543
+ Config : schedulerConfig ,
528
544
}
529
545
530
546
if err := s .db .WithContext (ctx ).Create (& scheduler ).Error ; err != nil {
0 commit comments