You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a simple in-memory TTL cache and integrate it across API handlers to reduce repeated cscli/docker calls and improve performance. Key changes:
- Add internal/cache: a concurrency-safe TTLCache with Get/Set.
- Instantiate cache in cmd/server and pass into RegisterServicesRoutes; handlers accept optional TTLCache.
- Cache decisions (including a lightweight summary), metrics, and alerts analysis with short TTLs.
- Add CLIFlag and appendCLIFlags helpers in handlers/common.go and refactor decision add/delete handlers to use them.
- Replace file copy helper in ImportDecisions with writing file bytes into the container via WriteFileToContainer.
- Add getExternalIP helper to try multiple external IP services; use it in GetPublicIP and WhitelistCurrentIP.
- Add FollowContainerLogs to the Docker client and update StreamLogs to follow container logs natively (streaming ReadCloser), simplifying polling logic and reducing duplicate-send logic.
- Web UI: add getDecisionsSummary API call and update Dashboard to use the summary endpoint and reduce auto-refresh frequency/labels.
These changes aim to reduce load, improve responsiveness, simplify log streaming, and centralize common helpers.
0 commit comments