Skip to content

Conversation

@Zhaoyikaiii
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive caching support to the unify-query service, implementing a distributed singleflight pattern to prevent redundant queries across multiple service instances. The implementation uses a two-tier caching strategy with Ristretto for local in-memory caching and Redis for distributed coordination and storage.

Key changes:

  • New cache service with distributed singleflight pattern using Redis pub/sub
  • HTTP cache middleware to intercept and cache API responses
  • Global cache initialization and lifecycle management

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/unify-query/cache/cache.go Core cache service implementing distributed singleflight with Redis pub/sub and Ristretto local cache
pkg/unify-query/cache/manager.go Global cache singleton management with initialization and cleanup
pkg/unify-query/cache/cache_test.go Test for distributed singleflight behavior across nodes
pkg/unify-query/service/http/middleware/cache.go HTTP middleware for request/response caching with configurable paths and methods
pkg/unify-query/service/http/middleware/cache_test.go Test for cache middleware with concurrent requests
pkg/unify-query/service/http/service.go Integration of cache middleware into HTTP service
pkg/unify-query/cmd/root.go Cache initialization at application startup and cleanup at shutdown
pkg/unify-query/go.mod Moved unused dependencies to indirect, updated Go version to 1.21.0
pkg/unify-query/go.sum Updated dependency versions
pkg/sliwebhook/go.mod Updated Go version to 1.21.0
pkg/influxdb-proxy/go.mod Updated Go version to 1.21.0 and dependency versions
pkg/bkmonitorbeat/go.mod Updated dependency versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- 添加缓存服务支持
- 添加Redis相关配置和路由
- 实现HTTP中间件缓存功能
- 添加缓存相关测试用例
@Zhaoyikaiii Zhaoyikaiii force-pushed the feat/support_query_cache/#1010158081128800655 branch from 52d08e2 to 3ff7851 Compare November 25, 2025 09:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 22 changed files in this pull request and generated 19 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 16 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant