Changelog: 0.1.3

This commit is contained in:
Mukhtar Akere
2024-09-01 13:17:15 +01:00
parent 74791d6e62
commit d405e0d8e0
11 changed files with 398 additions and 111 deletions

View File

@@ -1,19 +1,22 @@
package cmd
import (
"cmp"
"goBlack/common"
"goBlack/debrid"
"sync"
)
func Start(config *common.Config) {
deb := debrid.NewDebrid(config.Debrid)
maxCacheSize := cmp.Or(config.MaxCacheSize, 1000)
cache := common.NewCache(maxCacheSize)
deb := debrid.NewDebrid(config.Debrid, cache)
var wg sync.WaitGroup
if config.Proxy.Enabled {
proxy := NewProxy(*config, deb)
proxy := NewProxy(*config, deb, cache)
wg.Add(1)
go func() {
defer wg.Done()
@@ -22,10 +25,11 @@ func Start(config *common.Config) {
}
if len(config.Arrs) > 0 {
blackhole := NewBlackhole(config, deb, cache)
wg.Add(1)
go func() {
defer wg.Done()
StartBlackhole(config, deb)
blackhole.Start()
}()
}