mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fix: missing name and max runners when registering nodes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user