- JobRepository::claim_next() — atomic SELECT FOR UPDATE SKIP LOCKED + UPDATE status=processing in one query, no duplicate claims - ExecutePipelineHandler skips start() for already-claimed jobs - Sweep spawns N concurrent tasks via JoinSet, claims are fast+sequential, execution is slow+concurrent - Graceful shutdown: stop claiming, await all in-flight JoinSet tasks - WORKER_CONCURRENCY env (default: CPU cores) - DB_MAX_CONNECTIONS env (default: 20, was hardcoded 10) - VolumeFileResolver impl for InMemoryFileStorage (test fix)
56 lines
2.3 KiB
Plaintext
56 lines
2.3 KiB
Plaintext
# ============================================================================
|
|
# K-Photos Configuration
|
|
# ============================================================================
|
|
# Copy this file to .env and adjust values for your environment.
|
|
|
|
# ============================================================================
|
|
# Server
|
|
# ============================================================================
|
|
HOST=0.0.0.0
|
|
PORT=8000
|
|
|
|
# ============================================================================
|
|
# Database
|
|
# ============================================================================
|
|
DATABASE_URL=postgres://kphotos:kphotos@localhost:5432/kphotos
|
|
|
|
# ============================================================================
|
|
# JWT
|
|
# ============================================================================
|
|
JWT_SECRET=change-me-in-production-at-least-32-characters
|
|
|
|
# ============================================================================
|
|
# NATS
|
|
# ============================================================================
|
|
NATS_URL=nats://localhost:4222
|
|
|
|
# ============================================================================
|
|
# CORS
|
|
# ============================================================================
|
|
CORS_ALLOWED_ORIGINS=http://localhost:8000,http://localhost:5173
|
|
|
|
# ============================================================================
|
|
# Storage
|
|
# ============================================================================
|
|
STORAGE_PATH=./data/media
|
|
|
|
# ============================================================================
|
|
# Uploads (default 256 MiB)
|
|
# ============================================================================
|
|
# MAX_UPLOAD_BYTES=268435456
|
|
|
|
# ============================================================================
|
|
# Worker concurrency (default: number of CPU cores)
|
|
# ============================================================================
|
|
# WORKER_CONCURRENCY=8
|
|
|
|
# ============================================================================
|
|
# Trash (default 30 days before permanent purge)
|
|
# ============================================================================
|
|
# TRASH_RETENTION_DAYS=30
|
|
|
|
# ============================================================================
|
|
# Logging
|
|
# ============================================================================
|
|
RUST_LOG=info
|