Add logs route, add rar handler
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
netHttp "net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
// _ "net/http/pprof" // Register pprof
|
||||
|
||||
@@ -20,7 +21,9 @@ import (
|
||||
)
|
||||
|
||||
func MainApp(configPath string) {
|
||||
log := logutil.NewLogger()
|
||||
utils.EnsureDirExists("logs") // Ensure the logs directory exists
|
||||
logPath := fmt.Sprintf("logs/zurg-%s.log", time.Now().Format(time.DateOnly))
|
||||
log := logutil.NewLogger(logPath)
|
||||
zurglog := log.Named("zurg")
|
||||
|
||||
zurglog.Debugf("PID: %d", os.Getpid())
|
||||
@@ -42,8 +45,7 @@ func MainApp(configPath string) {
|
||||
}
|
||||
defer p.Release()
|
||||
|
||||
utils.EnsureDirExists("data")
|
||||
|
||||
utils.EnsureDirExists("data") // Ensure the data directory exists
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd, p, log.Named("manager"))
|
||||
|
||||
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, config, log.Named("dlclient"))
|
||||
|
||||
Reference in New Issue
Block a user