Add indexer cache with River queue for scheduled refresh

This commit is contained in:
Alexander
2026-05-07 21:41:17 +02:00
parent 2041c154cf
commit 79f3f145de
22 changed files with 686 additions and 26 deletions
+12
View File
@@ -2,6 +2,7 @@ package config
import (
"fmt"
"time"
)
const (
@@ -21,11 +22,16 @@ type Config struct {
Port string `yaml:"port"`
} `yaml:"app"`
Database struct {
URL string `yaml:"url"`
} `yaml:"database"`
Indexer struct {
Url string `yaml:"url"`
Port string `yaml:"port"`
Type IndexerType `yaml:"type"`
ApiKey string `yaml:"api_key"`
Cache CacheConfig `yaml:"cache"`
} `yaml:"indexer"`
Torrent struct {
@@ -40,6 +46,12 @@ type Config struct {
} `yaml:"metadata"`
}
type CacheConfig struct {
Enabled bool `yaml:"enabled"`
RefreshInterval time.Duration `yaml:"refresh_interval"`
TTL time.Duration `yaml:"ttl"`
}
func (t *IndexerType) UnmarshalYAML(unmarshal func(any) error) error {
var value string
if err := unmarshal(&value); err != nil {