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
)
