* fix(backend): fixed issue with wrong expiration timeout for projects in cache layer * fix(backend): removed direct call db.GetProject() * feat(backend): set default PROJECT_EXPIRATION to 10 minutes
21 lines
407 B
Go
21 lines
407 B
Go
package cache
|
|
|
|
import (
|
|
"openreplay/backend/pkg/db/postgres"
|
|
"time"
|
|
)
|
|
|
|
type PGCache struct {
|
|
*postgres.Conn
|
|
Cache Cache
|
|
}
|
|
|
|
func NewPGCache(conn *postgres.Conn, projectExpiration time.Duration) *PGCache {
|
|
// Create in-memory cache layer for sessions and projects
|
|
c := NewCache(conn, projectExpiration)
|
|
// Return PG wrapper with integrated cache layer
|
|
return &PGCache{
|
|
Conn: conn,
|
|
Cache: c,
|
|
}
|
|
}
|