Skip to content

Commit

Permalink
fix(engine): do not force register on update binary (#6634)
Browse files Browse the repository at this point in the history
* fix(engine): do not force register on update binary

Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault authored Oct 11, 2023
1 parent 66ec567 commit e728821
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions engine/api/workermodel/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ func ComputeRegistrationNeeds(db gorp.SqlExecutor, allBinaryReqs sdk.Requirement

for _, r := range reqs {
switch r.Type {
case sdk.BinaryRequirement:
exist := false
for _, e := range allBinaryReqs {
if e.Value == r.Value {
exist = true
break
}
}
if !exist {
return updateAllToCheckRegistration(db)
}
case sdk.OSArchRequirement:
nbOSArchReq++
case sdk.ModelRequirement:
Expand Down Expand Up @@ -63,21 +52,6 @@ func ComputeRegistrationNeeds(db gorp.SqlExecutor, allBinaryReqs sdk.Requirement
return nil
}

// updateAllToCheckRegistration is like need_registration but without exclusive mode
func updateAllToCheckRegistration(db gorp.SqlExecutor) error {
query := `UPDATE worker_model SET check_registration = $1`
res, err := db.Exec(query, true)
if err != nil {
return sdk.WithStack(err)
}
rows, err := res.RowsAffected()
if err != nil {
return sdk.WithStack(err)
}
log.Debug(context.Background(), "updateAllToCheckRegistration> %d worker model(s) check registration", rows)
return nil
}

// UpdateSpawnErrorWorkerModel updates worker model error registration
func UpdateSpawnErrorWorkerModel(db gorp.SqlExecutor, modelID int64, spawnError sdk.SpawnErrorForm) error {
spawnError.Error = sdk.RemoveNotPrintableChar(spawnError.Error)
Expand Down

0 comments on commit e728821

Please sign in to comment.