Feat/Flaresolverr support (#12)
* new: feat: add flaresolverr support * chg: feat: add session pool * chg: fix: deadlock error * chg: fix: make it work without flaresolverr
This commit is contained in:
10
main.go
10
main.go
@@ -1,11 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
handler "github.com/felipemarinho97/torrent-indexer/api"
|
||||
"github.com/felipemarinho97/torrent-indexer/cache"
|
||||
"github.com/felipemarinho97/torrent-indexer/monitoring"
|
||||
"github.com/felipemarinho97/torrent-indexer/requester"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
@@ -13,7 +16,10 @@ func main() {
|
||||
redis := cache.NewRedis()
|
||||
metrics := monitoring.NewMetrics()
|
||||
metrics.Register()
|
||||
indexers := handler.NewIndexers(redis, metrics)
|
||||
|
||||
flaresolverr := requester.NewFlareSolverr(os.Getenv("FLARESOLVERR_ADDRESS"), 60000)
|
||||
req := requester.NewRequester(flaresolverr, redis)
|
||||
indexers := handler.NewIndexers(redis, metrics, req)
|
||||
|
||||
indexerMux := http.NewServeMux()
|
||||
metricsMux := http.NewServeMux()
|
||||
@@ -31,7 +37,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
|
||||
fmt.Println("Server listening on :7006")
|
||||
err := http.ListenAndServe(":7006", indexerMux)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user