Skip to content

Add missing redis dependency to auth-service#116

Merged
Senthil455 merged 8 commits into
mainfrom
fix/issue-43-redis-dep
Jun 17, 2026
Merged

Add missing redis dependency to auth-service#116
Senthil455 merged 8 commits into
mainfrom
fix/issue-43-redis-dep

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Add redis ^4.6.0 to package.json dependencies. The code at index.js:13 requires('redis') but it was not listed, causing MODULE_NOT_FOUND at runtime.

Add SIGINT/SIGTERM signal handling, context-based cancellation for
background goroutines, and proper app.Shutdown() to all three Go
services to prevent connection leaks on Kubernetes pod termination.

- attendance-service: signal.Notify -> app.ShutdownWithContext
- lms-service: signal.Notify -> app.ShutdownWithContext
- notification-go-service: signal.Notify -> http.Server.Shutdown
- All background goroutines accept context.Context for clean shutdown
Wrap RabbitMQ consumer setup in an infinite reconnection loop so that
consumers automatically reconnect when the connection drops, instead of
permanently terminating the goroutine.

- attendance-service: consumeEmployeeDeletions now retries on disconnect
- notification-go-service: setupRabbitMQConsumer now retries on disconnect
- Exponential backoff from 1s to 30s max on each retry attempt
Limit total WebSocket connections (max 1000) and enforce per-IP rate
limiting (max 10 per IP) to prevent resource exhaustion attacks.

- maxClients = 1000 global limit checked before upgrade
- maxConnsPerIP = 10 limit enforced per client IP address
- canAcceptConnection/releaseConnection for tracking IP counts
- Client struct extended with clientIP field for cleanup
- Existing readPump cleanup extended to release IP count
Remove tenant_id query parameter that could bypass the X-Tenant-Id
header set by auth middleware. Always use the header value and return
403 if missing.
…d as department

Remove incorrect SQL alias e.employee_id as department that caused per-employee
data to be labeled as department-level analytics. Rename struct field from
Department to EmployeeID to match what the query actually returns.

Also fix 10 unchecked .Count() calls in the Overview function that were
previously missed.

@Senthil455 Senthil455 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One-line fix adding the redis dependency that was already required in the code.

@Senthil455 Senthil455 merged commit befc5cd into main Jun 17, 2026
4 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant