File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ require (
11
11
github.com/creachadair/command v0.1.15
12
12
github.com/creachadair/flax v0.0.1
13
13
github.com/creachadair/gocache v0.0.0-20240904225701-6c4617815112
14
- github.com/creachadair/mds v0.19.2
14
+ github.com/creachadair/mds v0.19.3
15
15
github.com/creachadair/mhttp v0.0.0-20240907154916-d408c0542750
16
16
github.com/creachadair/scheddle v0.0.0-20240908173745-88f3b31b6673
17
17
github.com/creachadair/taskgroup v0.9.3
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ github.com/creachadair/flax v0.0.1 h1:it+joEf9aEUalaV7XWll/pk6zA4/FbNvMImW9q/lS8
48
48
github.com/creachadair/flax v0.0.1 /go.mod h1:K8bFvn8hMdAljQkaKNc7I3os5Wk36JxkyCkfdZ7S8d4 =
49
49
github.com/creachadair/gocache v0.0.0-20240904225701-6c4617815112 h1:FSlFO2eztBGGzp67D2z/eeNe5U+AZyj4g/CjKf0AHbo =
50
50
github.com/creachadair/gocache v0.0.0-20240904225701-6c4617815112 /go.mod h1:vkGW73GdzBPQZJdFlPBZVzFcG7lTxIgDY0+U30mp3xs =
51
- github.com/creachadair/mds v0.19.2 h1:I5OdjsrG2jqGklMcyv50Iqo6gTrwUSIpIJVSnlVw85c =
52
- github.com/creachadair/mds v0.19.2 /go.mod h1:4b//mUiL8YldH6TImXjmW45myzTLNS1LLjOmrk888eg =
51
+ github.com/creachadair/mds v0.19.3 h1:qBkZ5d8SNtJZXQTYs7tYqEIwCD6ifchNTIjhYRThLNw =
52
+ github.com/creachadair/mds v0.19.3 /go.mod h1:4b//mUiL8YldH6TImXjmW45myzTLNS1LLjOmrk888eg =
53
53
github.com/creachadair/mhttp v0.0.0-20240907154916-d408c0542750 h1:fJzQV75gKAfx1Od7EiQI9rn0wTvO7Uc/YgQW54y77dQ =
54
54
github.com/creachadair/mhttp v0.0.0-20240907154916-d408c0542750 /go.mod h1:WDSdP3YUQE4YJNxq77RUCZRIvh1l2o8y58bbHsBffo4 =
55
55
github.com/creachadair/msync v0.3.0 h1:7FoPzwrM4gAdfsj7mcVyodKV82fArJaKcgr9j9whYww =
Original file line number Diff line number Diff line change @@ -155,3 +155,5 @@ type memCacheEntry struct {
155
155
header http.Header
156
156
body []byte
157
157
}
158
+
159
+ func entrySize (e memCacheEntry ) int64 { return int64 (len (e .body )) }
Original file line number Diff line number Diff line change @@ -114,13 +114,9 @@ func (s *Server) init() {
114
114
s .initOnce .Do (func () {
115
115
nt := runtime .NumCPU ()
116
116
s .tasks , s .start = taskgroup .New (nil ).Limit (nt )
117
- s .mcache = cache .New (cache.Config [string , memCacheEntry ]{
118
- Limit : 10 << 20 ,
119
- Store : cache .LRU [string , memCacheEntry ](),
120
- Size : func (e memCacheEntry ) int64 {
121
- return int64 (len (e .body ))
122
- },
123
- })
117
+ s .mcache = cache .New (10 << 20 , cache .LRU [string , memCacheEntry ]().
118
+ WithSize (entrySize ),
119
+ )
124
120
s .expire = scheddle .NewQueue (nil )
125
121
})
126
122
}
You can’t perform that action at this time.
0 commit comments