feat(worker): process attachments with thumbnails and bounded retries

This commit is contained in:
kk10
2026-11-15 16:50:27 +03:00
parent 8b0ab5440d
commit 19152e7d18
15 changed files with 994 additions and 50 deletions
+14
View File
@@ -141,6 +141,20 @@ func LoadS3() S3Config {
}
}
type WorkerConfig struct {
Concurrency int
MaxAttempts int
Timeout time.Duration
}
func LoadWorker() WorkerConfig {
return WorkerConfig{
Concurrency: getEnvPositiveInt("WORKER_CONCURRENCY", 2),
MaxAttempts: getEnvPositiveInt("JOB_MAX_ATTEMPTS", 5),
Timeout: time.Duration(getEnvPositiveInt("JOB_TIMEOUT_SECONDS", 60)) * time.Second,
}
}
func getEnv(key, def string) string {
value := os.Getenv(key)
if value == "" {