We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I run
go run cmd/server/main.go
server starts, outputs
Running...
Then I run
curl 'localhost:8081/set?key=a&value=1'
server outputs
Set: [a]1
then I run
curl 'localhost:8081/cache?key=a'
Fetching value for key 'a'
curl hangs for a while then outputs
context deadline exceeded
I expect server will output the value 1 set for the key a
1
a
The text was updated successfully, but these errors were encountered:
Also, the same code (with removed expiration time on the line 27 ) works well with the original golang/groupcache package
golang/groupcache
$ curl 'localhost:8081/set?key=a&value=1' -i HTTP/1.1 200 OK Date: Thu, 01 Aug 2024 16:46:31 GMT Content-Length: 0 $ curl 'localhost:8081/cache?key=a' -i HTTP/1.1 200 OK Date: Thu, 01 Aug 2024 16:46:33 GMT Content-Length: 2 Content-Type: text/plain; charset=utf-8 1
Sorry, something went wrong.
Problem is:
addr defaults to :8080:
addr
:8080
https://github.com/mailgun/groupcache/blob/master/cmd/server/main.go#L38
addr := flag.String("addr", ":8080", "server address")
Then this line renders current URL as http://:8080:
http://:8080
https://github.com/mailgun/groupcache/blob/master/cmd/server/main.go#L44
pool := groupcache.NewHTTPPoolOpts(fmt.Sprintf("http://%s", *addr), &groupcache.HTTPPoolOptions{})
And the peers var should include the (corrected) URL that is passed to NewHTTPPoolOpts.
peers
NewHTTPPoolOpts
No branches or pull requests
I run
server starts, outputs
Then I run
curl 'localhost:8081/set?key=a&value=1'
server outputs
then I run
server outputs
curl hangs for a while then outputs
I expect server will output the value
1
set for the keya
The text was updated successfully, but these errors were encountered: