Files
decypharr/main.go
Mukhtar Akere 7d954052ae - Refractor code
- Add a better logging for 429 when streaming
- Fix minor issues
2025-04-01 06:37:10 +01:00

40 lines
802 B
Go

package main
import (
"context"
"flag"
"github.com/sirrobot01/debrid-blackhole/cmd/decypharr"
"github.com/sirrobot01/debrid-blackhole/internal/config"
"log"
"os"
"os/signal"
"runtime/debug"
"syscall"
)
func main() {
defer func() {
if r := recover(); r != nil {
log.Printf("FATAL: Recovered from panic in main: %v\n", r)
debug.PrintStack()
}
}()
var configPath string
flag.StringVar(&configPath, "config", "/data", "path to the data folder")
flag.Parse()
if err := config.SetConfigPath(configPath); err != nil {
log.Fatal(err)
}
config.Get()
// Create a context that's cancelled on SIGINT/SIGTERM
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := decypharr.Start(ctx); err != nil {
log.Fatal(err)
}
}