Skip to content

Commit

Permalink
log long evaluating systems including db udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Jul 12, 2023
1 parent 4ad914a commit 3a9df7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion evaluator/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,14 @@ func updateSystemPlatform(tx *gorm.DB, system *models.SystemPlatform,
data["third_party"] = system.ThirdParty
}

err := tx.Model(system).Updates(data).Error

now := time.Now()
if system.LastUpload.Sub(now) > time.Hour {
// log long evaluating systems
utils.LogWarn("id", system.InventoryID, "lastUpload", *system.LastUpload, "now", now, "uploadEvaluationDelay")
}
return tx.Model(system).Updates(data).Error
return err
}

func callVMaas(ctx context.Context, request *vmaas.UpdatesV3Request) (*vmaas.UpdatesV2Response, error) {
Expand Down

0 comments on commit 3a9df7a

Please sign in to comment.