INNER CODE UNIT · Go
handleQueueMessage
VersusControl/versus-incident · cmd/main.go:528
func handleQueueMessage(content *map[string]interface{}) error {
// Stamp the ingress transport so persisted incidents say "sqs"
// instead of the default "http". Agent-originated incidents carry
// their own Source and ignore this hint.
overwrite := map[string]string{"incident_source": "sqs"}
return services.CreateIncident("", content, &overwrite) // teamID as empty string
}
// newRedisClient builds the Redis client both subsystems share. It reuses
// handlerRedisOptions for the addr/password/TLS settings, then returns either a
// single-node client (the default) or a cluster-aware client when the operator
// opts in via redis.cluster / REDIS_CLUSTER. Both concrete types satisfy
// redis.UniversalClient, so callers thread the interface and single-key
// Get/Set follow MOVED/ASK redirects transparently in cluster mode.
func newRedisClient(rc c.RedisConfig) redis.UniversalClient {
opts := handlerRedisOptions(rc)
if rc.ClusterEnabled() {
return redis.NewClusterClient(&redis.ClusterOptions{