Skip to content

Commit

Permalink
fix: store cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina-Sakai committed Feb 3, 2025
1 parent 4903274 commit df96208
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/generic/httpthrift_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (c *httpThriftCodec) getMessageReaderWriter() interface{} {
rw := thrift.NewHTTPReaderWriter(svcDsc)
c.configureHTTPRequestWriter(rw.WriteHTTPRequest)
c.configureHTTPResponseReader(rw.ReadHTTPResponse)

newCache := &cachedHTTPReaderWriterData{
svcDsc: svcDsc,
readerWriter: rw,
Expand Down
5 changes: 5 additions & 0 deletions pkg/generic/jsonthrift_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ func (c *jsonThriftCodec) getMessageReaderWriter() interface{} {
rw := thrift.NewJsonReaderWriter(svcDsc)
c.configureJSONWriter(rw.WriteJSON)
c.configureJSONReader(rw.ReadJSON)
newCache := &cachedJSONReaderWriterData{
svcDsc: svcDsc,
readerWriter: rw,
}
c.cachedReaderWriterData.Store(newCache)
return rw
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/generic/mapthrift_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ func (c *mapThriftCodec) getMessageReaderWriter() interface{} {
}
c.configureStructWriter(rw.WriteStruct)
c.configureStructReader(rw.ReadStruct)
newCache := &cachedStructReaderWriter{
svcDsc: svcDsc,
readerWriter: rw,
}
c.cachedReaderWriterData.Store(newCache)
return rw
}

Expand Down

0 comments on commit df96208

Please # to comment.