rdev/internal/worker/timeouts.go
jordan d69da6d627 feat: add structured logging infrastructure and SDLC extensions
Major changes:
- Add internal/logging package with field constants, context propagation,
  sensitive data auto-redaction, and per-component log levels
- Add worker timeout constants (TimeoutQuickOp, TimeoutHealthCheck, etc.)
- Extend SDLC with callback handlers, generate endpoints, and executor
- Add new cookbook trees for aeries and slackpath progression
- Add skeleton templates for queue, realtime, and microservices
- Add worker component template with async job processing
- Refactor services and handlers to use new logging infrastructure
- Split component.go into component_infra.go and component_listing.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:56:04 -07:00

31 lines
1.3 KiB
Go

package worker
import "time"
// Worker operation timeout categories.
//
// Use these constants instead of inline magic numbers in context.WithTimeout calls.
// Choose the category that matches the operation's characteristics:
//
// - TimeoutQuickOp: simple DB queries, metrics refresh, deregistration
// - TimeoutHealthCheck: parallel health checks against external systems
// - TimeoutMaintenance: maintenance operations (requeue, cleanup, mark stale)
// - TimeoutWorkExecution: long-running work execution (commands, builds)
const (
// TimeoutQuickOp is for simple, fast operations (metrics refresh, deregister, quick queries).
// 5 seconds. These should complete nearly instantly.
TimeoutQuickOp = 5 * time.Second
// TimeoutHealthCheck is for health checks against external systems (registry, CI, git).
// 10 seconds. Multiple parallel checks with headroom for slow responses.
TimeoutHealthCheck = 10 * time.Second
// TimeoutMaintenance is for maintenance operations (requeue stale tasks, cleanup old data).
// 30 seconds. These may involve multiple DB operations.
TimeoutMaintenance = 30 * time.Second
// TimeoutWorkExecution is for executing work items (commands, builds, agent tasks).
// 10 minutes. Long-running operations that stream output.
TimeoutWorkExecution = 10 * time.Minute
)