fix: missing name and max runners when registering nodes

This commit is contained in:
Marvin Zhang
2024-07-03 14:57:33 +08:00
parent b609beaf20
commit 2d203e61b9
2 changed files with 7 additions and 8 deletions

View File

@@ -58,11 +58,13 @@ func (svr NodeServerV2) Register(ctx context.Context, req *grpc.NodeServiceRegis
} else if errors2.Is(err, mongo.ErrNoDocuments) {
// register new
node = &models.NodeV2{
Key: req.Key,
Status: constants.NodeStatusRegistered,
Active: true,
ActiveAt: time.Now(),
Enabled: true,
Key: req.Key,
Name: req.Name,
Status: constants.NodeStatusRegistered,
Active: true,
ActiveAt: time.Now(),
Enabled: true,
MaxRunners: int(req.MaxRunners),
}
node.SetCreated(primitive.NilObjectID)
node.SetUpdated(primitive.NilObjectID)

View File

@@ -119,9 +119,6 @@ var _service interfaces.NodeConfigService
var _serviceOnce = new(sync.Once)
func GetNodeConfigService() interfaces.NodeConfigService {
if _service != nil {
return _service
}
_serviceOnce.Do(func() {
var err error
_service, err = newNodeConfigService()