feat: update dependencies and improve caching mechanism
Some checks failed
PR Check / check-and-test (pull_request) Failing after 2m11s
Some checks failed
PR Check / check-and-test (pull_request) Failing after 2m11s
- Added Prometheus client library for metrics collection. - Refactored garbage collection strategy from random deletion to LRU (Least Recently Used) deletion. - Introduced per-key locking in cache to prevent race conditions. - Enhanced logging with structured log messages for cache hits and misses. - Implemented a retry mechanism for upstream requests with exponential backoff. - Updated Go modules and indirect dependencies for better compatibility and performance. - Removed unused sync filesystem implementation. - Added version initialization to ensure a default version string.
This commit is contained in:
@@ -15,9 +15,6 @@ func TestCaching(t *testing.T) {
|
||||
|
||||
sc := New("localhost:8080", "1GB", 10, "1GB", 100, td, "", false)
|
||||
|
||||
sc.dirty = true
|
||||
sc.LogStats()
|
||||
|
||||
if err := sc.vfs.Set("key", []byte("value")); err != nil {
|
||||
t.Errorf("Set failed: %v", err)
|
||||
}
|
||||
@@ -25,9 +22,6 @@ func TestCaching(t *testing.T) {
|
||||
t.Errorf("Set failed: %v", err)
|
||||
}
|
||||
|
||||
sc.dirty = true
|
||||
sc.LogStats()
|
||||
|
||||
if sc.diskgc.Size() != 17 {
|
||||
t.Errorf("Size failed: got %d, want %d", sc.diskgc.Size(), 17)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user