mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 01:05:32 +00:00
Lenz: bisschen server
This commit is contained in:
21
server/cache.go
Normal file
21
server/cache.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gofiber/storage/memory/v2"
|
||||
)
|
||||
|
||||
type Cache struct {
|
||||
*memory.Storage
|
||||
}
|
||||
|
||||
const (
|
||||
CACHE_GC_INTERVAL = 24 * time.Hour
|
||||
)
|
||||
|
||||
func NewCache() Cache {
|
||||
return Cache{memory.New(memory.Config{
|
||||
GCInterval: CACHE_GC_INTERVAL,
|
||||
})}
|
||||
}
|
||||
Reference in New Issue
Block a user