Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

677 B
Raw Blame
package api

import (
	"sync"
	"time"

	"github.com/rs/zerolog/log"
)

const legacyHostAliasLogInterval = 15 * time.Minute

var legacyHostAliasLastLogged sync.Map

func noteLegacyHostAliasUsage(aliasPath string) {
	recordDeprecatedAPIUsage("host_agent_api_alias", aliasPath)

	now := time.Now()
	if lastRaw, ok := legacyHostAliasLastLogged.Load(aliasPath); ok {
		if last, ok := lastRaw.(time.Time); ok && now.Sub(last) < legacyHostAliasLogInterval {
			return
		}
	}

	legacyHostAliasLastLogged.Store(aliasPath, now)
	log.Warn().
		Str("path", aliasPath).
		Msg("Deprecated Unified Agent compatibility alias used; upgrade agents to canonical /api/agents/agent/* endpoints")
}