feat(worker): process attachments with thumbnails and bounded retries
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user