data provider: micro-optimization

skip availability check when updating the node timestamp.
If the update succeeds, the data provider is healthy

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-10-26 09:48:47 +01:00
parent 5ce9688780
commit 973b68a383

View File

@@ -84,11 +84,14 @@ func addScheduledCacheUpdates() error {
func checkDataprovider() { func checkDataprovider() {
if currentNode != nil { if currentNode != nil {
if err := provider.updateNodeTimestamp(); err != nil { err := provider.updateNodeTimestamp()
if err != nil {
providerLog(logger.LevelError, "unable to update node timestamp: %v", err) providerLog(logger.LevelError, "unable to update node timestamp: %v", err)
} else { } else {
providerLog(logger.LevelDebug, "node timestamp updated") providerLog(logger.LevelDebug, "node timestamp updated")
} }
metric.UpdateDataProviderAvailability(err)
return
} }
err := provider.checkAvailability() err := provider.checkAvailability()
if err != nil { if err != nil {