All checks were successful
CI / build (push) Successful in 53s
- Split single sync.Mutex into per-map mutexes (activeJobs, stepStates, rateLimiter, pendingInput, cancelFuncs) to reduce contention - Add download semaphore (channel-buffered, 3 concurrent) as worker pool - Add cancelFuncs map with context cancellation wired into download goroutines for clean shutdown - Replace playlist busy-poll (500ms sleep loop) with synchronous runDownload + Done channel for completion tracking - Use full UUID for job IDs instead of 8-char prefix - Download thumbnail URL to temp file before sending (InputFileUpload) - Change MAX_FILE_SIZE_MB default from 2000 to 50 - Clean up cancel funcs after normal download completion
23 lines
636 B
Go
23 lines
636 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
const (
|
|
RateLimitInterval = 1 * time.Second
|
|
ProgressThreshold = 5.0
|
|
MaxFileSizeEnvKey = "MAX_FILE_SIZE_MB"
|
|
DefaultMaxFileSize = 50
|
|
DefaultDailyQuotaMB = 100
|
|
DefaultWeeklyQuotaMB = 500
|
|
DefaultMonthlyQuotaMB = 2000
|
|
CleanupInterval = 10 * time.Second
|
|
FileRetention = 1 * time.Hour
|
|
DownloadDirEnvKey = "DOWNLOAD_DIR"
|
|
DefaultDownloadDir = "/tmp/uptodown"
|
|
CookiesFileEnvKey = "COOKIES_FILE"
|
|
DBPathEnvKey = "DB_PATH"
|
|
DefaultDBPath = "data/uptodown.db"
|
|
DateLayout = "2006-01-02"
|
|
QuotaProgressThreshold = 50.0
|
|
)
|