package handlers

import (
	"net/http"
	"time"

	"github.com/fiskerinc/cloud-services/services/jetfire/services"

	"github.com/fiskerinc/cloud-services/pkg/logger"
)

func ResetSchemaDefinitions(w http.ResponseWriter, r *http.Request) {
	startTime := time.Now()
	logger.Info().Msg("resetting tracked variables and schemas")
	services.ResetCacheVars()
	endTime := time.Now()
	logger.Debug().Msgf("reset tracked variables and schemas, time taken: %fms; %d variables",
		float64(endTime.UnixMilli()-startTime.UnixMilli()),
		len(services.GetFeatureVars()),
	)
}
