@@ -3,6 +3,7 @@ package images
|
||||
import (
|
||||
"os"
|
||||
|
||||
"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/pkg/config"
|
||||
"github.com/valkey-io/valkey-go"
|
||||
"golang.org/x/sync/semaphore"
|
||||
)
|
||||
@@ -17,13 +18,15 @@ type Service struct {
|
||||
fs fileSystem
|
||||
cache valkey.Client
|
||||
seph *semaphore.Weighted
|
||||
cfg *config.ImageConfig
|
||||
}
|
||||
|
||||
func New(fs fileSystem, cache valkey.Client, maxConcurency int64) *Service {
|
||||
func New(fs fileSystem, cfg *config.ImageConfig, cache valkey.Client) *Service {
|
||||
return &Service{
|
||||
fs: fs,
|
||||
cache: cache,
|
||||
seph: semaphore.NewWeighted(maxConcurency),
|
||||
seph: semaphore.NewWeighted(cfg.Concurency),
|
||||
cfg: cfg,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user