Skip to content

Commit

Permalink
Clear cache
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlogic committed May 19, 2023
1 parent 662980f commit 805ea48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ type Server struct {
}

func (s *Server) Read(ctx context.Context, req *pb.ReadRequest) (*pb.ReadResponse, error) {
if val, ok := s.cache[req.GetKey()]; ok {
/*if val, ok := s.cache[req.GetKey()]; ok {
return &pb.ReadResponse{Value: &anypb.Any{Value: val}}, nil
}
}*/
cmd := s.rdb.Get(ctx, req.GetKey())
result, err := cmd.Bytes()

Expand All @@ -54,7 +54,7 @@ func (s *Server) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResp
if err != nil {
log.Printf("remote err on write: %v", err)
} else {
s.cache[req.GetKey()] = req.GetValue().GetValue()
//s.cache[req.GetKey()] = req.GetValue().GetValue()
}
return &pb.WriteResponse{}, err
}
Expand Down

0 comments on commit 805ea48

Please sign in to comment.