Added invalidate cache button (through a generic APIButton widget)

This commit is contained in:
2022-07-07 01:12:22 +02:00
parent 095b08e300
commit 2807b551ba
7 changed files with 55 additions and 7 deletions
+5
View File
@@ -52,6 +52,11 @@ func (s *Service) LoadScripts() error {
return nil
}
func (s *Service) InvalidateCache() {
log.Printf("Invalidating monitor cache")
s.scriptOutputCache = map[string]cacheEntry{}
}
func (s *Service) GetOutput(command string) (string, error) {
// check if output is present in cache
if entry, found := s.scriptOutputCache[command]; found {