Add dump and restore functionality for internal DBs

This commit is contained in:
arberkatellari
2025-03-28 19:36:41 +02:00
committed by Dan Christian Bogos
parent 17248c5dde
commit a168f262e2
70 changed files with 4077 additions and 303 deletions

View File

@@ -84,7 +84,7 @@ func (eeS *EventExporterS) SetupExporterCache() error {
continue // skip if caching is disabled
}
expCache[chID] = ltcache.NewCache(chCfg.Limit, chCfg.TTL, chCfg.StaticTTL, onCacheEvicted)
expCache[chID] = ltcache.NewCache(chCfg.Limit, chCfg.TTL, chCfg.StaticTTL, false, []func(itmID string, value any){onCacheEvicted})
// Precache exporters if required.
if chCfg.Precache {

View File

@@ -36,12 +36,12 @@ import (
var failedPostCache *ltcache.Cache
func init() {
failedPostCache = ltcache.NewCache(-1, 5*time.Second, false, writeFailedPosts) // configurable general
failedPostCache = ltcache.NewCache(-1, 5*time.Second, false, false, []func(itmID string, value any){writeFailedPosts}) // configurable general
}
// SetFailedPostCacheTTL recreates the failed cache
func SetFailedPostCacheTTL(ttl time.Duration) {
failedPostCache = ltcache.NewCache(-1, ttl, false, writeFailedPosts)
failedPostCache = ltcache.NewCache(-1, ttl, false, false, []func(itmID string, value any){writeFailedPosts})
}
func writeFailedPosts(_ string, value any) {