openreplay/backend/pkg/db/cache/pg-cache.go
Alexander 2abf063ba2
Sessions cache layer (#789)
* feat(backend/db): cache layer for sessions with auto deleting logic
2022-11-02 17:00:41 +01:00

20 lines
409 B
Go

package cache
import (
"openreplay/backend/pkg/db/postgres"
)
type PGCache struct {
*postgres.Conn
cache Cache
}
func NewPGCache(conn *postgres.Conn, projectExpirationTimeoutMs int64) *PGCache {
// Create in-memory cache layer for sessions and projects
c := NewCache(conn, projectExpirationTimeoutMs)
// Return PG wrapper with integrated cache layer
return &PGCache{
Conn: conn,
cache: c,
}
}