supports more env variables

This commit is contained in:
stefanodvx 2025-04-15 18:44:01 +02:00
parent 0eb9167178
commit ba77cc0e28
3 changed files with 38 additions and 8 deletions

View file

@ -21,11 +21,15 @@ import (
)
func DefaultConfig() *models.DownloadConfig {
downloadsDir := os.Getenv("DOWNLOADS_DIR")
if downloadsDir == "" {
downloadsDir = "downloads"
}
return &models.DownloadConfig{
ChunkSize: 10 * 1024 * 1024, // 10MB
Concurrency: 4,
Timeout: 30 * time.Second,
DownloadDir: "downloads",
DownloadDir: downloadsDir,
RetryAttempts: 3,
RetryDelay: 2 * time.Second,
Remux: true,